Serial and Disk I/O Basics 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. If the program is resumed, the terminal and the manual control pendant are automatically reattached if they were attached before the termination. NOTE: It is possible that another program task could have attached the terminal or manual control pendant. That would result in an error message when the stopped task is restarted.
Reading The READ instruction processes input from all devices. The basic READ instruction issues a request to the device attached on the indicated LUN and waits until a complete data record is received before program execution continues. (The length of the last record read can be obtained with the IOSTAT function with its second argument set to 2.) The GETC real-valued function returns the next data byte from an I/O device without waiting for a complete data record. It is commonly used to read data from the serial lines or the system terminal. It also can be used to read disk files in a byte-by-byte manner.
Special mode bits to allow reading with no echo are supported for terminal read operations. Terminal input also can be performed using the PROMPT instruction. The GETEVENT instruction can be used to read input from the system terminal. This may be useful in writing programs that operate on both graphics and nongraphics-based systems. To read data from a disk device, a file must be open on the corresponding logical unit. The FOPEN_ instructions open disk files. Writing The WRITE instruction processes output to serial and disk devices and to the terminal.
The basic WRITE instruction issues a request to the device attached on the indicated LUN, and waits until the complete data record is output before program execution continues. WRITE instructions accept format control specifiers that determine how output data is formatted, and whether or not an end of record mark should be written at the end of the record. Terminal output also can be performed using the PROMPT or TYPE instructions. A file must be open using the FOPENW or FOPENA instructions before data can be written to a disk device. FOPENW opens a new file. FOPENA opens an existing file and appends data to that file. eV+Language User's Guide, v2.x, 18318-000 Rev A Page 141