National Instruments NI-488.2 User Manual

Page 50

Advertising
background image

Chapter 4

Developing Your NI-488.2 Application

© National Instruments Corporation

4-13

NI-488.2 User Manual

is 0x01; otherwise, if the primary address is 1 and the secondary address is
0x67, then the 16-bit value is 0x6701.

Step 3. Initialize the Devices

Use

DevClearList

to clear the devices on the GPIB. The first argument

is the GPIB interface number. The second argument is the list of GPIB
addresses that were found to be listening as determined in Step 2.

Device Communication

Step 4. Communicate with the Devices

Communicate with the devices by sending them the

"*IDN?"

query and

then reading back the responses. Many devices respond to this query by
returning a description of the device. Refer to the documentation that came
with your GPIB devices to see specific instruction on the proper way to
communicate with them.

Step 4a.

Use

SendList

to send the

"*IDN?"

query command to multiple GPIB

devices. The address is the list of GPIB devices to be queried. The buffer
that you pass to

SendList

is the command message to the device.

Step 4b.

Use

Receive

for each device to read the responses from each device.

Continue communicating with the GPIB devices until you are finished.

Cleanup

Step 5. Place the Interface Offline before Exiting Your Application

Use

ibonl

to put the interface offline before you exit the application.

Advertising