Guardian Programmer's Guide

Table Of Contents
Communicating With Devices
Guardian Programmer’s Guide 421922-014
9 - 4
Controlling Devices
Controlling Devices
You use the following procedures to control devices:
CONTROL performs device-specific I/O operations like sending a form feed to a
printer or terminal or rewinding a magnetic tape.
CONTROLBUF is similar to CONTROL in that it specifies operations to be
performed on a device. CONTROLBUF, however, also enables buffered data to be
passed to a device. For example, you can use CONTROLBUF to load the direct
access vertical format unit (DAVFU) of a subtype 4 printer.
SETMODE provides several options for setting the operational mode of a device;
for example, the security level for future disk accesses, parity checking on a
terminal, the form length for a printer, or the packet size for an X.25
communications line.
SETMODENOWAIT provides the same functions as SETMODE but returns to the
caller immediately. SETMODENOWAIT finishes with a call to AWAITIO in the
same way as any other nowait operation. Refer to Section 4, Using Nowait
Input/Output, for details of nowait I/O.
SETPARAM is concerned with setting and getting parameters for controlling data
communications lines, and for establishing BREAK ownership for a terminal.
For complete details of command syntax for the above procedures, see the Guardian
Procedure Calls Reference Manual. This guide primarily describes CONTROL and
SETMODE (or SETMODENOWAIT). For programming information on the SETPARAM
procedure, refer to the data communications manuals.
SETMODE usually sets a condition within which a device will operate; the condition
remains in effect as long as the file remains open or until the condition is changed with
another call to SETMODE. CONTROL performs an operation on a device. For
example, you use the SETMODE procedure to set the form length for a printer;
SETMODE sets the condition. But to actually issue a form-feed character, you use the
CONTROL procedure.
The next three sections of this manual describe how SETMODE and CONTROL are
used to control terminals, printers, and magnetic tape drives. Specific examples are
given there, since use of these procedures is specific to the device type.
For information on the use of SETMODE and CONTROL with other data
communications lines, refer to the data communications manuals.