Status word (ibsta), Table 4-1. status word layout, Status word (ibsta) -7 – National Instruments NI-488.2 User Manual

Page 44

Advertising
background image

Chapter 4

Developing Your NI-488.2 Application

© National Instruments Corporation

4-7

NI-488.2 User Manual

if the sizes of

ibcnt

and

ibcntl

are the same,

ibcnt

and

ibcntl

are

equal. For cross-platform compatibility, all applications should use

ibcntl

.

For applications accessing the newer NI4882 API, use the global function
calls rather than the global variables. The global functions replace the
global variables with the newer NI4882 API.

Note

If your application is a multithreaded application, refer to the

Writing Multithreaded

NI-488.2 Applications

section in Chapter 8,

NI-488.2 Programming Techniques

.

Status Word (Ibsta)

All calls update a global status function,

Ibsta

, which contains

information about the state of the GPIB and your GPIB hardware. You can
examine various status bits in

Ibsta

and use that information to make

decisions about continued processing. If you check for possible errors after
each call using the

Ibsta

ERR bit, debugging your application is much

easier. When using the GPIB32 API,

ibsta

is the global variable.

Each bit in

Ibsta

can be set for device-level traditional NI-488.2 calls

(dev), board-level traditional NI-488.2 calls and multi-device NI-488.2
calls (brd), or all (dev, brd).

Ibsta

is a 32-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.

Table 4-1 shows the condition that each bit position represents, the bit
mnemonics, and the type of calls for which the bit can be set. For a detailed
explanation of each status condition, refer to Appendix B,

Status Word

Conditions

.

Table 4-1. Status Word Layout

Mnemonic

Bit

Pos

Hex

Value

Type

Description

ERR

15

8000

dev, brd

NI-488.2 error

TIMO

14

4000

dev, brd

Time limit exceeded

END

13

2000

dev, brd

END or EOS detected

SRQI

12

1000

brd

SRQ interrupt received

RQS

11

800

dev

Device requesting
service

Advertising