Envoy ACP/XF Application Programming Manual

Normal Response Mode (NRM) Protocols
EnvoyACP/XF Application Programming Manual132179
3-34
Pseudocode Examples
Pseudocode Examples
The examples in this subsection show the basic logic behind initializing a NRM link.
These are not actual code examples.
SDLC Point-to-Point Primary Station
This example shows how to initiate an SDLC link for a point-to-point primary station
that performs two-way alternate communication over half-duplex, nonswitched line
facilities.
In this example, the line name is $SDLC0.
!Open the line "SDLC0"
OPEN SDLC0,%36
If <> do error handling
!When using nonextended control mode
!you can open the line for exclusive read or write access and
!for nowait I/O with a maximum of 14 concurrent outstanding
!requests.
!The flags parameter %36 specifies all of those characteristics.
!The OPEN procedure assigns a unique line number to this
!particular opening of the line $SDLC0 and returns it to the
!application process by way of the line^fnum integer variable
!Get the current line setting.
SETMODE fnum,16,,,current_value !two words
If <> do error handling
!Set the line to point-to-point primary,
!half-duplex,nonswitched
!REJ supervisory frames not allowed
!RS-232C line interface
SETMODE fnum,16,%4
If <> do error handling
!Send SNRM
CONTROL fnum,13,0
If <> do error handling
AWAITIO fnum
If <> do error handling
.
.
.
If the point-to-point primary station is to perform two-way, simultaneous
communication over full-duplex, nonswitched line facilities, use the preceding sequence,
but modify the parameters in the SETMODE call as follows:
SETMODE fnum,16,%414