Cilxs_locksession – AMETEK Ls Series Driver Manual User Manual
Page 199

IVI Driver Manual
Lx / Ls Series
195
ciLxs_LockSession
ViStatus ciLxs_LockSession (ViSession instrumentHandle,
ViPBoolean callerHasLock);
Purpose
This function obtains a multithread lock on the instrument session.
Before it does so, it waits until all other execution threads have
released their locks on the instrument session.
Other threads might have obtained a lock on this session in the following
ways:
- The user's application called ciLxs_LockSession.
- A call to the instrument driver locked the session.
- A call to the IVI engine locked the session.
After your call to ciLxs_LockSession returns successfully, no other
threads can access the instrument session until you call
ciLxs_UnlockSession.
Use ciLxs_LockSession and ciLxs_UnlockSession around a sequence of calls
to instrument driver functions if you require that the instrument retain
its settings through the end of the sequence.
You can safely make nested calls to ciLxs_LockSession within the same
thread. To completely unlock the session, you must balance each call to
ciLxs_LockSession with a call to ciLxs_UnlockSession. If, however, you
use the Caller Has Lock parameter in all calls to ciLxs_LockSession and
ciLxs_UnlockSession within a function, the IVI Library locks the session
only once within the function regardless of the number of calls you make
to ciLxs_LockSession. This allows you to call ciLxs_UnlockSession just
once at the end of the function.
Parameter List
instrumentHandle
Variable Type ViSession
The ViSession handle that you obtain from the ciLxs_init or
ciLxs_InitWithOptions function. The handle identifies a particular
instrument session.
Default Value: None
callerHasLock
Variable Type ViBoolean (passed by reference)
This parameter serves as a convenience. If you do not want to use
this parameter, pass VI_NULL.