National Instruments NI-488.2 NI-488.2 User Manual page 47

National instruments network hardware - networking hardware user manual
Hide thumbs Also See for NI-488.2 NI-488.2:
Table of Contents

Advertisement

Chapter 4
Developing Your NI-488.2 Application
NI-488.2 User Manual
Initialization
Step 1. Become Controller-In-Charge (CIC)
Use
to initialize the bus and the GPIB interface so that the GPIB
SendIFC
interface is Controller-In-Charge (CIC). The only argument of
the GPIB interface number, typically 0 for
Step 2. Determine the GPIB Address of Your Device
Use
to find all the devices attached to the GPIB. The
FindLstn
function requires the following parameters:
Interface number (typically 0, for
A list of primary addresses, terminated with the
A list for reported GPIB addresses of devices found listening
on the GPIB.
Limit, which is the number of the GPIB addresses to report.
Use
to test for the presence of all of the primary addresses that
FindLstn
are passed to it. If a device is present at a particular primary address, then
the primary address is stored in the GPIB addresses list. Otherwise, all
secondary addresses of the given primary address are tested, and the GPIB
address of any devices found is stored in the GPIB addresses list. When you
have the list of GPIB addresses, you can determine which one corresponds
to your instrument and use it for subsequent calls.
Alternately, if you already know your GPIB device's primary and
secondary address, you can create an appropriate GPIB address to use in
subsequent NI-488.2 calls, as follows: a GPIB address is a 16-bit value that
contains the primary address in the low byte and the secondary address in
the high byte. If you are not using secondary addressing, the secondary
address is 0. For example, if the primary address is 1, then the 16-bit value
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
to clear the devices on the GPIB. The first argument
DevClearList
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.
GPIB0
GPIB0
4-10
SendIFC
.
FindLstn
).
constant.
NOADDR
is
ni.com

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents