Using multiple interfaces and/or multiple devices, Checking status with global functions, Checking status with global functions -6 – National Instruments NI-488.2 User Manual

Page 43

Advertising
background image

Chapter 4

Developing Your NI-488.2 Application

NI-488.2 User Manual

4-6

ni.com

The set of low-level functions are called board-level functions. They access
the interface directly and require you to handle the addressing and bus
management protocol. These functions give you the flexibility and control
to handle situations such as the following:

Communicating with non-compliant (non-IEEE 488.2) devices.

Altering various low-level interface configurations.

Managing the bus in non-typical ways.

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 Help. For instructions on accessing the online help, refer to
the

Using the NI-488.2 Documentation

section in

About This 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

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 Functions

For applications accessing the NI4882 API, each NI-488.2 call updates
three global functions to reflect the status of the device or board you are
using. These global status functions are the status word (

Ibsta

), the error

function (

Iberr

), and the count function (

Ibcnt

). They contain useful

information about the performance of your application. Your application
should check these functions after each NI-488.2 call. For more
information about each status function, refer to the following sections.

For applications accessing the older GPIB32 API (including the Visual
Basic 6.0 application interface), use the equivalent global variables. These
global status variables are the status word (

ibsta

), the error variable

(

iberr

), and the count variables (

ibcnt

and

ibcntl

).

ibcnt

is defined

to be the type

int

, while

ibcntl

is the size of type long

int

. For all cases,

Advertising