User`s guide

Programming with VISA 3
Agilent VISA User’s Guide 35
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 resource address
specified in the rsrcName parameter to open a resource
session. The vi parameter in viOpen returns a session
identifier that can be used with other VISA functions.
Your program may have several sessions open at the same
time after creating multiple session identifiers by calling the
viOpen function multiple times. The following table
summarizes the parameters in the previous function calls.
Table 5 Parameters Used in Function Calls
Parameter Description
sesn A session returned from the viOpenDefaultRM function that
identifies the resource manager session.
rsrcName A unique symbolic name of the resource (resource address).
accessMode Specifies the modes by which the resource is to be accessed.
The value VI_EXCLUSIVE_LOCK is used to acquire an exclusive
lock immediately upon opening a session. If a lock cannot be
acquired, the session is closed and an error is returned. The
VI_LOAD_CONFIG value is used to configure attributes specified
by some external configuration utility. If this value is not used,
the session uses the default values provided by this
specification.
Multiple access modes can be used simultaneously by specifying
a “bit-wise OR” of the values.
timeout If the accessMode parameter requires a lock, this parameter
specifies the absolute time period (in milliseconds) that the
resource waits to get unlocked before this operation returns an
error. Otherwise, this parameter is ignored.
vi This is a pointer to the session identifier for this particular
resource session. This pointer will be used to identify this
resource session when using other VISA functions.