How To Use The Status Registers - Keysight N9320B Programmer's Manual

Spectrum analyzer
Hide thumbs Also See for N9320B:
Table of Contents

Advertisement

Status Registers

How to use the Status Registers

How to use the Status Registers
26
A program often needs to detect and manage error conditions or
changes in instrument status. The polling method for you to
programmatically access the information in status registers.
In the polling method, the instrument has a passive role. It only
tells the controller that conditions have changed when the
controller asks the right question. In the SRQ method, the
instrument takes a more active role. It tells the controller when
there has been a condition change without the controller asking.
Either method allows you to monitor one or more conditions.
The polling method works well if you do not need to know about
changes the moment they occur. To detect a change using the
polling method, the program must repeatedly read the registers.
To monitor a condition:
— Determine which register contains the bit that reports the condi-
tion.
— Send the unique SCPI query that reads that register.
— Examine the bit to see if the condition has changed.
You can monitor conditions in different ways.
• Check the instrument hardware and firmware status.
Do this by querying the condition registers which continuously
monitor status. These registers represent the current state of the
instrument. Bits in a condition register are updated in real time.
When the condition monitored by a particular bit becomes true,
the bit is set to 1. When the condition becomes false, the bit is
reset to 0.
• Monitor a particular condition (bit).
You can enable a particular bit(s), using the event enable register.
The instrument will then monitor that particular condition(s). If the
bit becomes true (0 to 1 transition) in the event register, it will stay
set until the event register is cleared. Querying the event register
allows you to detect that this condition occurred even if the
condition no longer exists. The event register can only be cleared
by querying it or sending the *CLS command.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents