Checking Status with Global Variables
Note
If your application is a multithreaded application, refer to the section
Multithreaded Win32 NI-488.2 Applications
Techniques.
Status Word (ibsta)
© National Instruments Corporation
Board-level functions that an NI-488.2 application might use include the
following—
,
ibcmd
ibrd
to the NI-488.2 online help. For instructions on accessing the online help,
refer to the
Using the NI-488.2 Documentation
Manual.
Using Multiple Interfaces and/or Multiple Devices
When your system includes an interface that must access multiple devices,
use the multi-device NI-488.2 calls, which can perform the following tasks
with a single call:
•
Find the Listeners on the bus using
•
Find a device requesting service using
•
Determine the state of the SRQ line, or wait for SRQ to be asserted
using
or
TestSRQ
•
Address multiple devices to receive a command using
You can mix board-level traditional NI-488.2 calls with the multi-device
NI-488.2 calls to have access to all the NI-488.2 functionality.
Each NI-488.2 API call updates four global variables to reflect the status of
the device or interface that you are using. These global status variables are
the status word (
ibsta
variables (
and
ibcnt
performance of your application. Your application should check these
variables after each NI-488.2 call. The following sections describe each of
these global variables and how you can use them in your application.
All NI-488.2 calls update a global status word,
information about the state of the GPIB and the GPIB hardware. The value
stored in
is the return value of all the traditional NI-488.2 calls,
ibsta
except
and
ibfind
ibdev
and use that information to make decisions about continued processing. If
Chapter 3
,
, and
ibwrt
ibconfig
FindLstn
.
WaitSRQ
), the error variable (
). They contain useful information about the
ibcntl
in Chapter 7,
NI-488.2 Programming
. You can examine various status bits in
3-5
Developing Your NI-488.2 Application
. For a detailed list, refer
section in
About This
.
.
FindRQS
SendList
), and the count
iberr
Writing
, which contains
ibsta
NI-488.2 User Manual for Windows
.
ibsta