Specifications

Table Of Contents
Chapter 2 25
Programming Command Guidelines
Using the Status Registers
2. Programming Command
Guidelines
Using the Status Registers
The status system comprises multiple registers which are arranged in a hierarchical
order. The lower-priority status registers propagate their data to the higher-priority
registers in the data structures by means of summary bits. The status byte register
is at the top of the hierarchy and contains the general status information for the
instrument’s events and conditions. All other individual registers are used to
determine the specific events or conditions.
You can determine the state of certain instrument hardware and firmware events
and conditions by programming the status register system.
Individual status registers can be set and queried using the commands in the IEEE
common commands reference. A status register is actually composed of five
physical registers: a condition register, two transition registers, an event enable
register and an event register. However, a “standard event status register” is
composed of an event enable register and an event register.
Why Would You Use the Status Registers?
In general, your program often needs to be able to detect and manage error
conditions or changes in instrument status. To detect a change using the polling
method, the program must repeatedly read the registers to monitor a condition as
follows:
1. Determine which register contains the bit that reports the condition.
2. Send the unique query that reads that register.
3. Examine the bit to see if the condition has changed.
Using the Status Registers
Most monitoring of the instrument conditions is done at the highest level using the
IEEE common commands indicated below for the Test Set. Refer to “IEEE
Common Commands” on page 34 for more information about common
commands.
*CLS (clear status) clears the status byte by emptying the error queue and
clearing all the event registers.
*ESE, *ESE? (event status enable) sets and queries the bits in the enable
register part of the standard event status register.
*ESR? (event status register) queries and clears the event register part of the
standard event status register.
*OPC, *OPC? (operation complete) sets or queries the standard event status
register to monitor the completion of all commands. The query stops any new
commands from being processed until the current processing is complete, then
returns a ‘1’.