
Programming with VISA
3
Agilent VISA User’s Guide
75
VISA Lock Types
VISA defines two different types of locks:
Exclusive Lock
and
Shared
Lock
.
Exclusive Lock
- A session can lock a VISA resource using the lock
type VI_EXCLUSIVE_LOCK to get exclusive access privileges to
the resource. This exclusive lock type excludes access to the resource
from all other sessions.
If a session has an exclusive lock, other sessions cannot modify
global attributes or invoke operations on the resource. However, the
other sessions
can
still get attributes.
Shared Lock
- A session can share a lock on a VISA resource with
other sessions by using the lock type VI_SHARED_LOCK. Shared
locks in VISA are similar to exclusive locks in terms of access
privileges, but can still be shared between multiple sessions.
If a session has a shared lock, other sessions that share the lock can
also modify global attributes and invoke operations on the resource
(of course, unless some other session has a previous exclusive lock
on that resource). A session that does not share the lock will lack
these capabilities.
Locking a resource restricts access from other sessions, and in the case
where an exclusive lock is acquired, ensures that operations do not fail
because other sessions have acquired a lock on that resource. Thus,
locking a resource prevents other, subsequent sessions from acquiring
an exclusive lock on that resource. Yet, when multiple sessions have
acquired a shared lock, VISA allows one of the sessions to acquire an
exclusive lock along with the shared lock it is holding.
Also, VISA supports nested locking. That is, a session can lock the
same VISA resource multiple times (for the same lock type) via
multiple invocations of the
viLock
function. In such a case, unlocking
the resource requires an equal number of invocations of the
viUnlock
function. Nested locking is explained in detail later in this section.
Some VISA operations may be permitted even when there is an
exclusive lock on a resource, or some global attributes may not be read
when there is any kind of lock on the resource. These exceptions, when
applicable, are mentioned in the descriptions of the individual VISA
functions and attributes.
Summary of Contents for E2094S
Page 6: ...6 Agilent VISA User s Guide ...
Page 116: ...116 Agilent VISA User s Guide 4 Programming via GPIB and VXI ...
Page 126: ...126 Agilent VISA User s Guide 5 Programming via LAN ...
Page 143: ...Glossary Agilent VISA User s Guide 143 Windows notification area See notification area ...