Protocol Overview
The instrument and controller communicate using <program message>s and
<response message>s. These messages serve as the containers into which
sets of program commands or instrument responses are placed. <program
message>s are sent by the controller to the instrument, and <response
message>s are sent from the instrument to the controller in response to a
query message. A <query message> is defined as being a <program
message> which contains one or more queries. The instrument will only talk
when it has received a valid query message, and therefore has something to
say. The controller should only attempt to read a response after sending a
complete query message, but before sending another <program message>.
The basic rule to remember is that the instrument will only talk when
prompted to, and it then expects to talk before being told to do something
else.
Protocol Operation
When the instrument is turned on, the input buffer and output queue are
cleared, and the parser is reset to the root level of the command tree.
The instrument and the controller communicate by exchanging complete
<program message>s and <response message>s. This means that the
controller should always terminate a <program message> before attempting
to read a response. The instrument will terminate <response message>s
except during a hardcopy output.
If a query message is sent, the next message passing over the bus should be
the <response message>. The controller should always read the complete
<response message> associated with a query message before sending another
<program message> to the same instrument.
The instrument allows the controller to send multiple queries in one query
message. This is referred to as sending a "compound query." As will be
noted later in this chapter, multiple queries in a query message are separated
by semicolons. The responses to each of the queries in a compound query
will also be separated by semicolons.
Commands are executed in the order they are received.
Message Communication and System Functions
Protocols
5–4