User`s guide

4: Application Interface
DC 900-1516D 59
4.1.2.2 I/O Status Block (IOSB)
The programmer should always check the status field (first word) of the I/O Status
Block (IOSB) after each QIO completion. This field returns a VMS completion code or
error code that indicates the success of the call or reason for failure. The return codes
used by the ICP device driver are described in Section 4.2.4.6 on page 71. Note that
these error codes indicate VMS errors only and are different than the protocol error
codes that are returned in the data portion of the QIO read. Protocol-specific errors are
described in the Protogate programmers guide for the specific protocol you are using.
The fourth word of the IOSB contains the actual number of bytes transferred for READ
operations.
4.1.2.3 Buffer Address and Size (P1 and P2)
The P1 parameter contains the address of the buffer to be transferred to the ICP for
WRITE operations or the address of a buffer to receive data from the ICP for READ
operations. The address can be an array name or pointer to a data area. The buffer con-
sists of the protocol header(s) followed by an optional data area. If a data area exists, it
must immediately follow the protocol header.
For WRITE operations, the P2 parameter equals the total size (in bytes) of the protocol
header(s) plus any data that follows the header. The size of the data area must not
exceed the maximum buffer size specified by the protocol software or a VMS buffer
overflow error occurs. For example, if the maximum ICP buffer size is set to 1024 bytes,
the maximum value of the P2 parameter would be the size of the protocol header(s)
plus 1024.
For READ operations, the P2 parameter equals the size of the programs read buffer.
This buffer must be large enough to accept the protocol header(s) plus largest data area
expected from the ICP. Using the above example, the read buffer size would always be
header size plus 1024 bytes. When the read completes, the program can obtain the
actual number of bytes transferred from the I/O Status Block (IOSB). Since all ICP data