Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)
64 Chapter3
Common Device Control Functions
Reading From Asynchronous Devices
informed that the data will be transmitted as a block, sends another
read trigger when it is ready to accept the block of data. The second
read trigger is referred to as a block mode read trigger and is the same
character as the read trigger.
It is possible to specify an alternate character for use as the read trigger
(and therefore also the block mode read trigger) through the
FDEVICECONTROL intrinsic. You must take great care if you do so,
however, to assure that no data is lost.
Terminating Reads
Reads can be terminated in a number of ways, depending on the
programmatic controls issued by your program prior to posting the
read. Both the input mode (character or block mode) and the data
editing mode (binary, transparent, or standard editing mode) affect the
termination of reads.
Binary mode reads cannot be terminated by the recognition of any
character. Binary mode reads are terminated only by the byte count
being reached or by the expiration of the read limit timer. Only byte
count termination results in a successful binary mode read.
The following summarizes the events that will cause reads other than
binary mode reads to terminate
• An EOR character is sent from the terminal. This includes the block
mode read termination character (usually RS) if you are in block
mode and any EOR character specified in an FCONTROL(41) call or
through FDEVICECONTROL(192) with a controlcode value of 15
or 39. Reads terminated in this way terminate normally.
• An AEOR character defined in a preceding call to FCONTROL(25) is
sent from the terminal. The AEOR character is included in the data
and the byte count and the read terminates with an error condition
(FSERR 31). An AEOR character will be recognized in either
standard or transparent editing mode.
• The input byte count is reached. This count is set by a parameter in
the read intrinsic used for the read (FREAD, READ, or READX).
Reaching the input byte count causes all reads to terminate,
regardless of any other condition.
• The read limit timer set by a preceding call to FCONTROL(4)
expires. Setting this timeout value prevents a device from hanging
because of an incomplete read. The read data is transferred to the
user buffer and the read length is returned. The length is the
number of characters entered at the time of the timeout, and the
read terminates with SOFTWARE TIMEOUT (FSERR 22). Reaching
the timeout limit causes all reads to terminate, regardless of any
other condition. (During block mode reads, the timer halts when the
DC2 character is received.)