National Instruments NI-488.2 Benutzerhandbuch

Seite von 135
Chapter 3
Developing Your NI-488.2 Application
© National Instruments Corporation
3-5
Board-level functions that an NI-488.2 application might use include the 
following—
ibcmd
ibrd
ibwrt
, and 
ibconfig
. For a detailed list, refer 
to the NI-488.2 online help. For instructions on accessing the online help, 
refer to th
 section in 
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 
FindLstn
.
Find a device requesting service using 
FindRQS
.
Determine the state of the SRQ line, or wait for SRQ to be asserted 
using 
TestSRQ
 or 
WaitSRQ
.
Address multiple devices to receive a command using 
SendList
.
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.
Checking Status with Global Variables
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
), the error variable (
iberr
), and the count 
variables (
ibcnt
 and 
ibcntl
). They contain useful information about the 
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.
Note
If your application is a multithreaded application, refer to the section 
 in Chapter 7, 
Status Word (ibsta)
All NI-488.2 calls update a global status word, 
ibsta
, which contains 
information about the state of the GPIB and the GPIB hardware. The value 
stored in 
ibsta
 is the return value of all the traditional NI-488.2 calls, 
except 
ibfind
 and 
ibdev
. You can examine various status bits in 
ibsta
 
and use that information to make decisions about continued processing. If