Agilent Technologies E4406A VSA manual Device Sessions, viOpen sesn, rsrcName, accessMode, timeout

Models: E4406A VSA

1 406
Download 406 pages 63.49 Kb
Page 118
Image 118
Device Sessions

 

Programming Fundamentals

 

C Programming Using VTL

 

All devices that you will be using need to be connected and in working

NOTE

 

condition prior to the first VTL function call (viOpenDefaultRM). The

 

system is configured only on the first viOpenDefaultRM per process.

 

Therefore, if viOpenDefaultRM is called without devices connected and

 

then called again when devices are connected, the devices will not be

 

recognized. You must close ALL resource manager sessions and re-open

 

with all devices connected and in working condition.

 

Device Sessions

 

There are two parts to opening a communications session with a

 

specific device. First you must open a session to the default resource

 

manager with the viOpenDefaultRM function. The first call to this

 

function initializes the default resource manager and returns a session

 

to that resource manager session. You only need to open the default

 

manager session once. However, subsequent calls to viOpenDefaultRM

 

returns a session to a unique session to the same default resource

 

manager resource.

 

Next, you open a session with a specific device with the viOpen

 

function. This function uses the session returned from

 

viOpenDefaultRM and returns its own session to identify the device

 

session. The following shows the function syntax:

 

viOpenDefaultRM (sesn);

 

viOpen (sesn, rsrcName, accessMode, timeout, vi);

 

The session returned from viOpenDefaultRM must be used in the sesn

 

parameter of the viOpen function. The viOpen function then uses that

 

session and the device address specified in the rsrcName parameter to

 

open a device session. The vi parameter in viOpen returns a session

 

identifier that can be used with other VTL functions.

 

Your program may have several sessions open at the same time by

 

creating multiple session identifiers by calling the viOpen function

 

multiple times.

 

 

The following summarizes the parameters in the previous function

 

calls:

 

 

sesn

This is a session returned from the viOpenDefaultRM

 

 

function that identifies the resource manager session.

 

rsrcName

This is a unique symbolic name of the device (device

 

 

address).

 

accessMode

This parameter is not used for VTL. Use VI_NULL.

 

timeout

This parameter is not used for VTL. Use VI_NULL.

118

Chapter 2

Page 118
Image 118
Agilent Technologies E4406A VSA manual Device Sessions, viOpen sesn, rsrcName, accessMode, timeout