User`s guide

Programming with VISA 3
Agilent VISA User’s Guide 33
The example again uses the session returned from the resource manager,
with another VISA address, to open a session with the GPIB-VXI
device at primary address 9 and VXI logical address (secondary
address) 24. You will now identify this session as scanner when calling
other VISA functions. See the following section, “Addressing a
Session”, for information on addressing particular devices.
ViSession defaultRM, dmm, scanner;
.
viOpenDefaultRM(&defaultRM);
viOpen(defaultRM, "GPIB0::22::INSTR",VI_NULL,
VI_NULL,&dmm);
viOpen(defaultRM, "GPIB-VXI0::24::INSTR",
VI_NULL, VI_NULL,&scanner);
.
viClose(scanner);
viClose(dmm);
viClose(defaultRM);
Addressing a Session
As shown in the previous section, the rsrcName parameter in the
viOpen function is used to identify a specific resource. This parameter
consists of the VISA interface ID and the resource address. The
interface ID is determined when you run the Agilent Connection Expert
utility. The interface ID is usually the VISA interface type followed by a
number.
The following table illustrates the format of the rsrcName for different
VISA interface types. INSTR is an optional parameter that indicates that
you are communicating with a resource that is of type INSTR, meaning
instrument. The keywords are:
•ASRL - used for asynchronous serial devices.
•GPIB - used for GPIB devices and interfaces.
GPIB-VXI - used for GPIB-VXI controllers.
•TCPIP - used for LAN instruments.
VXI - used for VXI instruments.
•USB - used for USB instruments.