Automatic serial polling – National Instruments GPIB-PC User Manual
Page 74
Section Four
GPIB-PC Functions — Overview
©National Instruments Corp.
4-13
GPIB-PC User Manual
Automatic Serial Polling
If this feature is enabled, the handler automatically conducts serial polls
when SRQ is asserted. The handler polls all active devices and stores
each positive response, i.e., those responses that have the Request
Service (RQS) or hex 40 bit set in the device status byte, in a queue
associated with each device. Queues are necessary because some
devices can send multiple positive status bytes back-to-back. When a
positive response from a device is received, the RQS bit of its status
word (
IBSTA
) is set. The polling continues until SRQ is unasserted or
an error condition is undetected.
If the handler cannot locate the device requesting service (no known
device responds positively to the poll), or if SRQ becomes stuck on
(due to a faulty instrument or cable), then a GPIB system error exists
which will interfere with the proper evaluation of the RQS bit in the
device's status words. The error (ESRQ) will be reported to you if and
when you issue an
IBWAIT
call with the RQS bit included in the wait
mask. Should the error condition clear itself up, you will notice this by
calling
IBWAIT
with the RQS bit set in the mask, where the ESRQ
error will not be reported. Aside from the difficulty caused by this error
in waiting for RQS, the error will have no detrimental effects on other
GPIB operations.
If the serial poll function
IBRSP
is called and one or more responses
have been received previously via the automatic serial poll feature, then
the first queued response is returned by the
IBRSP
function in FIFO
(first in-first out) fashion. If the RQS bit of the status word is not set
when
IBRSP
is called, the function conducts a serial poll and returns
whatever response is received.
If your application requires that requests for service be noticed, you
should examine the RQS bit in the status word and call the
IBRSP
function to examine the status byte whenever it appears. It is possible
for a device's serial poll response queue to get clogged with old status
bytes when you neglect to call
IBRSP
to empty the queue. This error
condition (ESTB) is returned only by
IBRSP
when it becomes
necessary to report that status bytes have been discarded due to a full
queue. If your application has no interest in SRQ or status bytes, you
may ignore the occurrence of the automatic polls. The polls occur
rarely, and the error conditions described will not occur unless you use
the feature.