Chapter 3
Developing Your Application
© National Instruments Corp.
3-3
NI-488.2M UM for Windows NT
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 descriptior.
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.2M routines only.
Using NI-488.2 Routines: Multiple Boards and/or Multiple Devices
When your system includes a board that must access multiple devices, 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 Variables
Each NI-488 function and NI-488.2 routine updates four 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. The value stored in
ibsta
is the return value
of all of the NI-488 functions except
ibfind
and
ibdev
. You can test for the
conditions reported in
ibsta
and use that information to make decisions about
continued processing. If you check for possible errors after each call, debugging your
application is much easier.
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 (brd) and NI-488.2
calls, or all (dev, brd).