10
Keysight N778xC Series Polarization Instruments Programming Guide
1
Introduction to Programming
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. The parser starts if the LF character is received.
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 LF (0A
16
). 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.
The Error Queue
The error queue is 30 errors long. It is a FIFO queue (first-in first-out). That
is, the first error read is the oldest error to have occurred. For example:
1 If no error has occurred, the error queue contains:
+ 0, "N
o error"
2 After a command such as
wav:pow
, the error queue now contains:
+ 0, "N
o error"
-113, "Undefined header"
3 If the command is immediately repeated, the error queue now
contains:
+ 0, "N
o error"
-113, "Undefined header"
-113, "Undefined header"