Agilent Technologies 86120B Marine Instruments User Manual


 
4-21
Programming
Monitoring the Instrument
The *CLS common command clears all event registers and all queues except
the output queue. If *CLS is sent immediately following a program message
terminator, the output queue is also cleared. In addition, the request for the
*OPC bit is also cleared.
For example, suppose your application requires an interrupt whenever any
type of error occurs. The error related bits in the Standard Event Status Reg-
ister are bits 2 through 5. The sum of the decimal weights of these bits is 60.
Therefore, you can enable any of these bits to generate the summary bit by
sending the
*ESE 60
command.
Whenever an error occurs, it sets one of these bits in the Standard Event Sta-
tus Register. Because the bits are all enabled, a summary bit is generated to
set bit 5 in the Status Byte Register.
If bit 5 (ESB) in the Status Byte Register is enabled (via the *SRE command),
an SRQ service request interrupt is sent to the external computer.
Standard Event Status Register bits that are not enabled still respond to their
corresponding conditions (that is, they are set if the corresponding event
occurs). However, because they are not enabled, they do not generate a sum-
mary bit to the Status Byte Register.
Queues
There are two queues in the instrument: the output queue and the error
queue. The values in the output queue and the error queue can be queried.
Output queue
The output queue stores the instrument responses that are generated by cer-
tain commands and queries that you send to the instrument. The output
queue generates the Message Available summary bit when the output queue
contains one or more bytes. This summary bit sets the MAV bit (bit 4) in the
Status Byte Register. The method used to read the Output Queue depends
upon the programming language and environment. For example, with HP
BASIC, the output queue may be read using the ENTER statement.
Error queue
As errors are detected, they are placed in an error queue. Instrument specific
errors are indicated by positive values. General errors have negative values.
You can clear the error queue by reading its contents, sending the *CLS com-
mand, or by cycling the instrument’s power.