beautypg.com

Cilxs_unlocksession – AMETEK Ls Series Driver Manual User Manual

Page 263

background image

IVI Driver Manual

Lx / Ls Series

259

ciLxs_UnlockSession


ViStatus ciLxs_UnlockSession (ViSession instrumentHandle,
ViPBoolean callerHasLock);

Purpose

This function releases a lock that you acquired on an instrument session
using ciLxs_LockSession. Refer to ciLxs_LockSession for additional
information on session locks.


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.

Use this parameter in complex functions to keep track of whether you
obtain a lock and therefore need to unlock the session.
Pass the address of a local ViBoolean variable. In the declaration
of the local variable, initialize it to VI_FALSE. Pass the address
of the same local variable to any other calls you make to
ciLxs_LockSession or ciLxs_UnlockSession in the same function.

The parameter is an input/output parameter. ciLxs_LockSession and
ciLxs_UnlockSession each inspect the current value and take the
following actions:

- If the value is VI_TRUE, ciLxs_LockSession does not lock the
session again. If the value is VI_FALSE, ciLxs_LockSession obtains
the lock and sets the value of the parameter to VI_TRUE.

- If the value is VI_FALSE, ciLxs_UnlockSession does not attempt to
unlock the session. If the value is VI_TRUE, ciLxs_UnlockSession
releases the lock and sets the value of the parameter to VI_FALSE.

Thus, you can, call ciLxs_UnlockSession at the end of your function
without worrying about whether you actually have the lock.

Example:

ViStatus TestFunc (ViSession vi, ViInt32 flags)

This manual is related to the following products: