8163A/B, 8164A/B & 8166A/B Mainframes Programming Guide
13
Introduction to Programming
1
Message Queues
The instrument exchanges messages using an input and an output queue.
Error messages are kept in a separate error queue.
How the Input Queue Works
The input queue is a FIFO queue (first-in first-out). Incoming bytes are
stored in the input queue as follows:
1 Receiving a byte:
•
Clears the output queue.
•
Clears Bit 7 (MSB).
2 No modification is made inside strings or binary blocks. Outside strings
and binary blocks, the following modifications are made:
•
Lower-case characters are converted to upper-case.
•
The characters 00
16
to 09
16
and 0B
16
to 1F
16
are converted to
spaces (20
16
).
•
Two or more blanks are truncated to one.
3 An EOI (End Or Identify) sent with any character is put into the input
queue as the character followed by a line feed (LF, 0A
16
). If EOI is sent
with a LF, only one LF is put into the input queue.
4 The parser starts if the LF character is received or if the input queue is
full.
Clearing the Input Queue
Switching the power off, or sending a Device Interface Clear signal, causes
commands that are in the input queue, but have not been executed to be
lost.
The Output Queue
The output queue contains responses to query messages. The instrument
transmits any data from the output queue when a controller addresses the
instrument as a talker.
Each response message ends with a carriage return (CR, 0D
16
) and a LF
(0A
16
), with EOI=TRUE. If no query is received, or if the query has an error,
the output queue remains empty.
The Message Available bit (MAV, bit 4) is set in the Status Byte register
whenever there is data in the output queue.