Agilent Technologies E4406A VSA manual Addressing a Session, functions

Models: E4406A VSA

1 406
Download 406 pages 63.49 Kb
Page 119
Image 119
identify this device session when using other VTL

 

Programming Fundamentals

 

C Programming Using VTL

vi

This is a pointer to the session identifier for this

 

particular device session. This pointer will be used to

 

identify this device session when using other VTL

 

functions.

The following is an example of opening sessions with a GPIB multimeter and a GPIB-VXI scanner:

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);

The above function first opens a session with the default resource manager. The session returned from the resource manager and a device address is then used to open a session with the GPIB device at address

22.That session will now be identified as dmm when using other VTL functions. The session returned from the resource manager is then used again with another device address to open a session with the GPIB-VXI device at primary address 9 and VXI logical address 24. That session will now be identified as scanner when using other VTL functions. See the following section for information on addressing particular devices.

Addressing a Session

As seen in the previous section, the rsrcName parameter in the viOpen function is used to identify a specific device. This parameter is made up of the VTL interface name and the device address. The interface name is determined when you run the VTL Configuration Utility. This name is usually the interface type followed by a number. The following table illustrates the format of the rsrcName for the different interface types:

Interface

Syntax

 

 

VXI

VXI [board]::VXI logical address[::INSTR]

 

 

GPIB-VXI

GPIB-VXI [board]::VXI logical address[::INSTR]

 

 

GPIB

GPIB [board]::primary address[::secondary address][::INSTR]

 

 

Chapter 2

119

Page 119
Image 119
Agilent Technologies E4406A VSA manual Addressing a Session, identify this device session when using other VTL, functions