6530 Programmer's Guide

Tandem NonStop Kernel Application Interface
6530 Programmer’s Guide
4-3
File System
Procedure Calls
To communicate with a terminal, your application typically first calls the
OPEN procedure with the symbolic name for the device.
Then to write data (which can include control codes and escape sequences
as well as displayable data) to the terminal, your application calls the
WRITE procedure, passing the name of the buffer containing the data to
be written.
To read data from the terminal, your application calls the READ
procedure, passing the name of the buffer that will contain the data read
from the terminal.
A procedure called Write/Read combines a write operation followed by a
read operation. Use of the Write/Read procedure ensures that the host
system is ready to receive data from a terminal immediately after a
message is written to the terminal. This is useful for prompting a terminal
user for input in conversational mode. It is also useful for issuing escape
sequences that initiate reads from the terminal, for example, read terminal
configuration ESC ?).
Note Escape sequences that initiate reads from the terminal should
be the only text in the application’s buffer when the Write/Read
procedure is called. Although other text in the buffer may
appear to operate correctly, timing conflicts in communications
and the terminal may cause errors to occur. Other than these
escape sequences, the buffer can contain control codes,
escape sequences, and displayable data mixed in any logical
order.
Also note that the Write/Read procedure does not issue a carriage return/
line feed character sequence to the terminal after the write phase of the
write/read sequence.
Several other procedures are available for operations on terminals, as
summarized in Table 4-1 on page 4-4. See the Tandem NonStop Kernel
programmer’s guide for more information on these procedures. Also refer
to the appropriate access method manual for terminals controlled by I/O
processes other than TERMPROCESS.