AM3270/TR3271 Reference Manual

Details of the CRT Protocol
AM3270 Subdevice Protocols
4–16 086705 Tandem Computers Incorporated
SETMODE 59 Operation SETMODE 59 returns the actual count of bytes read as a result of a CONTROL 22
(two-step READ) completion. The format is:
CALL SETMODE (filenumber, 59, , , params);
filenumber
INT:value, the file number returned by the OPEN for the subdevice.
59
INT:value, the SETMODE number for obtaining the actual count of the bytes read.
params
INT:ref:2, must be provided and returns:
params[0] actual number of bytes read.
params[1] 0 (zero).
Note that the parameter positions normally used for param1 and param2 are not
used and parameters must not be provided. If they are, an Error 2 (invalid
operation attempted) will be returned to the caller. Error 26 will be returned if the
subdevice has no outstanding two-step READs completed or if the SETMODE
requestor is not the two-step READ requester.
SETMODE 59 Example
The following is a functional example of the application request sequence using a two-
step READ and a SETMODE 59:
CALL OPEN (T^NAME,T1,FLAGS); open the subdevice.
.
.
CALL CONTROL (T1,22,500); post a 500-byte READ to T1
CALL AWAITIO (T1, ... ); and wait for completion.
.
.
CALL SETMODE (T1,59,,,PARAMS); read has completed, get
. the actual size.
.
CALL READ(T1,BUFFER,PARAMS[0]); .I/O has completed using
. the actual message size
. rather than 500.
WRITE Request A WRITE request causes polling to be halted. A select operation is initiated for the
subdevice. If the select is properly acknowledged by the device, AM3270 adds the
communication control characters to the text to be written and writes it to the device.
Completion of the physical write to the device causes the WRITE request to be
completed.