
72
Chapter 2
Programming Fundamentals
Using the Instrument Status Registers
Why Would You Use the Status Registers?
Your program often needs to be able to detect and manage error
conditions or changes in instrument status. There are two methods you
can use to programmatically access the information in status registers:
• The polling method
• The service request (SRQ) method
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 analyzer 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. The SRQ method should be used if you
must know immediately when a condition changes. To detect a change
using the polling method, the program must repeatedly read the
registers.
Use the SRQ method when:
— you need time-critical notification of changes
— you are monitoring more than one device which supports SRQs
— you need to have the controller do something else while waiting
— you can’t afford the performance penalty inherent to polling
Use polling when:
— your programming language/development environment does not
support SRQ interrupts
— you want to write a simple, single-purpose program and don’t want
the added complexity of setting up an SRQ handler
To monitor a condition:
1. Determine which register contains the bit that reports the condition.
2. Send the unique SCPI query that reads that register.
3. Examine the bit to see if the condition has changed.
Содержание E4406A VSA Series
Страница 4: ...4 ...
Страница 59: ...59 2 Programming Fundamentals ...
Страница 76: ...76 Chapter2 Programming Fundamentals Using the Instrument Status Registers Overall Status Register System ...
Страница 124: ...124 Chapter2 Programming Fundamentals Using the LAN to Control the Analyzer ...
Страница 125: ...125 3 Programming Examples ...
Страница 164: ...164 Chapter3 Programming Examples Using Java Programming Over Socket LAN ...
Страница 165: ...165 4 Programming Command Cross References ...
Страница 379: ...379 6 Error Messages ...
Страница 412: ...412 Chapter6 Error Messages Error Message Descriptions ...