Envoy ACP/XF Application Programming Manual

Normal Response Mode (NRM) Protocols
EnvoyACP/XF Application Programming Manual132179
3-37
ADCCP-NRM Point-to-Point Secondary
!Bits 3 through 7 of the MCW should contain the value %20 and
!the AWAITIO call should complete with CCG (indicating that
!the received frame generated a nonzero MCW)
AWAITIO fnum
If <> do error handling
ADCCP-NRM Point-to-Point Secondary
The example below shows how to open and initialize an ADCCP point-to-point
secondary-station application that performs two-way, alternate communication over half-
duplex, nonswitched, line facilities.
In this example, the line name is $ADCP1. The application uses a 2-octet address field, a
2-octet control field, and three line openings.
!Open the line
!This OPEN opens the line $ADCP1 for shared read or write access
OPEN ADCP1,fnum^1,%16
If <> do error handling
OPEN,ADCP1,fnum^2,%16
If <> do error handling
OPEN,ADCP1,fnum^3,%16
If <> do error handling
!Get the current line setting.
SETMODE fnum,16,,,current_value !two words
If <> do error handling
!The following SETMODE ensures that certain crucial
! parameters are set:
!Point-to-point secondary station
!Half-duplex line facilities (two-way alternate operation)
!Nonswitched lines
!REJ supervisory frame not allowed
!RS-232C line interface
SETMODE fnum^1,16,%0
If <> do error handling
!The following SETMODE call specifies
!2-octet address field
!2-octet control field
SETMODE fnum^1,19,,%30000)
If <> do error handling
!A READ call activates the read unit of EnvoyACP/XF in
preparation for accepting the SNRME command
!from the primary
READ fnum^1,read^buffer,256
If <> do error handling
!The following AWAITIO call completes the previous READ
!request as soon as the SNRME is received.
!Bits 3 through 7 of the MCW should contain the value %20 and