November 1985
National Instruments
wait Wait for Selected Event
wait: General Use function
Syntax: wait
Purpose: You use
wait
to monitor selected GPIB events and to
delay any further GPIB-MAC activity until one of them
occurs.
Remarks: The argument
mask
is a numeric string which 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
may be expressed as decimal, octal, or hexadecimal.
After receiving the wait programming message, the
GPIB-MAC monitors GPIB activity. When any event
corresponding to the bits set in mask occurs, the
MAC 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
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-MAC from waiting indefinitely for
SRQ to be asserted, set the SRQI and
bits by
setting the mask equal to 4096 + 16384. This will
cause the wait to terminate either on SRQI or TIMO,
whichever occurs first.
85
SECTION FOUR FUNCTIONS