INSTRUMENT POLLS
Continuous Poll
GPIB Operation 3
State transitions occurring within the instrument can be remotely
monitored by polling selected internal status registers. This sub-
section discusses a number of polling methods which may be used
to detect the occurrence of a given event.
1. Continuous poll
2. Serial poll
3.
Parallel poll
4. *IST poll
To emphasize the differences between these methods, the same
example will be presented in each case, i.e. determining if a new
acquisition has taken place. By far the simplest poll is the continu-
ous poll. The other methods only make sense if interrupt service
routines (servicing the SRQ line) are supported or if multiple de-
vices on GPIB must be monitored simultaneously.
In continuous polling a status register is continuously monitored
until a transition is observed. This is the most straightforward
method for detecting state changes but may be impracticable in
some situations, especially in multiple device configurations.
In the following example, the event "new signal acquired" is ob-
served by continuously polling the INternal state change Register
(INR) until the corresponding bit (in this case bit 0, i.e. value 1)
non-zero to indicate that a new waveform has been acquired.
Reading INR clears it at the same time so that there is no need for
an additional clearing action after a non-zero value has been de-
tected. The command "CHDR OFF" instructs the instrument to
omit any command headers when responding to a query. This sim-
plifies the decoding of the response. The instrument would
therefore send "1" rather than "INR 1".
CMD$="CHDR OFF"
CALL IBWRT(SCOPE%,CMD$)
MASK% = 1
’New Signal Bit has value 1
LOOP% = 1
WHILE LOOP%
CMD$="INR?"
CALL IBWRT(SCOPE%,CMD$)
CALL IBRD(SCOPE%,RD$)
NEWSIG% = VAL(RD$) AND MASK%
IF NEWSIG% = MASK% THEN LOOP% = 0
WEND
21