
32
Agilent VISA User’s Guide
3
Programming with VISA
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.
Example: Opening a Resource Session
This code sample shows
one way of opening resource sessions with a GPIB multimeter and a
GPIB-VXI scanner. The sample first opens a session with the default
resource manager. The example then uses the session returned from the
resource manager, and a VISA address, to open a session with the GPIB
device at address 22. You can now identify that session as
dmm
when
you call other VISA functions.
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.
Содержание E2094S
Страница 6: ...6 Agilent VISA User s Guide ...
Страница 116: ...116 Agilent VISA User s Guide 4 Programming via GPIB and VXI ...
Страница 126: ...126 Agilent VISA User s Guide 5 Programming via LAN ...
Страница 143: ...Glossary Agilent VISA User s Guide 143 Windows notification area See notification area ...
Страница 144: ...144 Agilent VISA User s Guide Glossary ...