Chapter 5
S Mode Functions
© National Instruments Corp.
5-57
GPIB-232CT User Manual
wait - Wait for Selected Event
Type:
General Use function
Syntax:
wa
it mask
<CR>
Purpose:
You
use
wait
to monitor selected GPIB events and to delay
any further GPIB-232CT activity until any of them occur.
Remarks:
The
argument
mask
is a numeric string that specifies the
events to wait for. The numeric string represents a bit mask
containing a subset of the same bit assignments as the status
word described in the
stat
function. Each bit is set or
cleared to wait or not to wait, respectively, for the
corresponding event to occur. The numeric string can be
expressed as decimal, octal, or hexadecimal.
After receiving the
wait
programming message, the
GPIB-232CT monitors GPIB activity. When any event
corresponding to the bits set in
mask
occurs, the
GPIB-232CT returns status information indicating its current
status. If continuous status reporting has been enabled, status
will be reported in the format requested. If continuous status
has not been enabled, status will be returned in numeric
format.
You could use
wait
, for example, if you wish to wait until a
device requests service before you perform a serial poll. In
this case, you send the wait programming message with
mask=4096
, then wait for status information to be returned.
You then check that status to see if the SRQI bit is set in the
returned status indicators.
To prevent the GPIB-232CT from waiting indefinitely for
SRQ to be asserted, set the SRQI and TIMO bits by setting the
mask equal to
4096 + 16384
. This will cause the wait to
terminate either on SRQI or TIMO, whichever occurs first.