User`s guide

The error message associated with a negative value from IOSTAT can be found in the V+
Language Reference Guide. The $ERROR string function can be used in a program (or with
the LISTS monitor command) to generate the text associated with most I/O errors.
It is good practice to use IOSTAT to check each I/O operation performed, even if you think it
cannot fail (hardware problems can cause unexpected errors).
NOTE:It is not necessary to use IOSTAT after use of a GETC function, since errors are
returned directly by the GETC function.
Attaching/Detaching Logical Units
In general, an I/O device must be attached using the ATTACH instruction before it can be
accessed by a program. Once a specific device (such as the manual control pendant) is
attached by one program task, it cannot be used by another program task. Most I/O requests
fail if the device associated with the referenced LUN is not attached.
Each program task has its own sets of disk and graphics logical units. Thus, more than one
program task can attach the same logical unit number in those groups at the same time
without interference.
A physical device type can be specified when the logical unit is attached. If a device type is
specified, it supersedes the default, but only for the logical unit attached. The specified device
type remains selected until the logical unit is detached.
An attach request can optionally specify immediate mode. Normally, an attach request is
queued, and the calling program is suspended if another control program task is attached to
the device. When the device is detached, the next attachment in the queue will be
processed. In immediate mode, the ATTACH instruction completes immediately-with an
error if the requested device is already attached by another control program task.
With V+ systems, attach requests can also specify no-wait mode. This mode allows an attach
request to be queued without forcing the program to wait for it to complete. The IOSTAT
function must then be used to determine when the attach has completed.
If a task is already attached to a logical unit, it will get an error immediately if it attempts to
attach again without detaching, regardless of the type of wait mode specified.
When a program is finished with a device, it detaches the device with the DETACH program
instruction. This allows other programs to process any pending I/O operations.
When a control program completes execution normally, all I/O devices attached by it are
automatically detached. If a program stops abnormally, however, most device attachments
are preserved. If the control program task is resumed and attempts to reattach these logical
units, it may fail because of the attachments still in effect. The KILL monitor command
forces a program to detach all the devices it has attached.
If attached by a program, the terminal and manual control pendant are detached whenever
the program halts or pauses for any reason, including error conditions and single-step mode.
Serial and Disk I/O Basics
(Undefined variable: Primary.Product_Name_V)Language User's Guide, version
17.x
Page 211