Envoy ACP/XF Application Programming Manual

EnvoyACP/XF and the Application Task
EnvoyACP/XF Application Programming Manual132179
1-10
Transferring Data
Establishing a Connection
The procedure calls for establishing a connection depend upon whether the line is
switched or nonswitched:
Transferring Data
Once the link has been established in ABM, NRM, or one of the extended modes, your
application can begin transferring data. In EnvoyACP/XF, your application transfers data
through calls to the WRITE, READ, and WRITEREAD procedures. Every such call
must refer to the name of the integer array that your application uses as an I/O buffer.
Each WRITE call transmits one I-frame or U-frame to a remote station. Each READ call
accepts one incoming frame (I-frame, U-frame, or S-frame) from a remote station. The
READ procedure then passes received data and control information to the application
through the buffer referred to in the associated READ call.
A WRITEREAD performs a WRITE operation followed by a READ operation. The
READ operation is not queued until the WRITE operation completes. Both operations
use the same application buffer. You should not use WRITEREAD procedure calls
routinely.
Message Control Word
For all modes, the first two bytes of an application I/O buffer must be reserved for the
Message Control Word (MCW).
The information put into the application buffer by a READ or taken from the process
buffer by a WRITE consists of a 2-byte MCW followed by the received/transmitted data.
If the frame being received or transmitted contains no information field, only the MCW
portion of the buffer is used. For additional information on the MCW and its contents,
see the READ[X] Procedure
on page 4-10 and the WRITE[X] Procedure on page 4-19.
WRITE, READ, and WRITEREAD Requests and Nowait I/O
When a line is opened for waited I/O, each call within your application must complete
before control passes to the next instruction or statement. However, if the line is opened
for nowait I/O, a call initiates the specified operation and immediately passes control to
Switched Nonswitched
FILE_OPEN_ (no connection) FILE_OPEN_ (now have connection)
SETMODE (optional)* SETMODE (optional)*
1. CONTROL 17,0 SETMODE 16
(until have connection) or
2. CONTROL 17, 1 or CONTROL 11
(now have connection)
CONTROL 11 and 17 optional
* Note that SETMODE 16, 17, or 19 reinitializes the link. Thus, the application must issue CONTROL to
reconnect a switched line. Since most nonswitched line configurations use switched-line configurations as a
backup, use the procedures for switched calls as a general rule.