Chapter 3 Developing Your Application
© National Instruments Corp. 3-3 NI-488.2 User Manual for Windows
The NI-488 board functions are compatible with, and can be interspersed within,
sequences of NI-488.2 routines. When you use board functions within a sequence of
NI-488.2 routines, you do not need a prior call to ibfind to obtain a board descriptor.
You simply substitute the board index as the first parameter of the board function call.
With this flexibility, you can handle non-standard or unusual situations that you cannot
resolve using NI-488.2 routines only.
Using NI-488.2 Routines: Multiple Boards and/or Multiple Devices
When your system includes a board that must access more than one device, use the
NI-488.2 routines. NI-488.2 routines can perform the following tasks with a single call:
• Find all of the Listeners on the bus
• Find a device requesting service
• Determine the state of the SRQ line, or wait for SRQ to be asserted
• Address multiple devices to listen
Checking Status with Global VariablesEach NI-488 function and NI-488.2 routine updates the global variables to reflect the
status of the device or board that you are using. The status word (ibsta), the error
variable (iberr), and the count variables (ibcnt and ibcntl) contain useful
information about the performance of your application program. Your program should
check these variables frequently. The following sections describe each of these global
variables and how you can use them in your application program.
Status Word – ibsta
All functions update a global status word, ibsta, which contains information about the
state of the GPIB and the GPIB hardware. Most of the NI-488 functions return the value
stored in ibsta. You can test for conditions reported in ibsta to make decisions
about continued processing, or you can debug your program by checking ibsta after
each call.
ibsta is a 16-bit value. A bit value of one (1) indicates that a certain condition is in
effect. A bit value of zero (0) indicates that the condition is not in effect. Each bit in
ibsta can be set for NI-488 device calls (dev), NI-488 board calls and NI-488.2 calls
(brd), or all (dev, brd).