niDCPower_UnlockSession
- Updated2025-10-06
- 2 minute(s) read
Releases a lock that you acquired on an device session using niDCPower_LockSession. Refer to niDCPower_LockSession for additional information on session locks.
Syntax
ViStatus _VI_FUNC niDCPower_UnlockSession(ViSession vi, ViBoolean *callerHasLock)
Parameters
| Name | Direction | Type | Description |
|---|---|---|---|
| vi | [in] | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
| callerHasLock | [out] | ViBoolean * | This attribute is optional. If you do not want to use this attribute, pass VI_NULL. Use this attribute 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 niDCPower_LockSession or niDCPower_UnlockSession in the same function. The parameter is an input/output parameter. niDCPower_LockSession and niDCPower_UnlockSession each inspect the current value and take the following actions.
Thus, you can, call niDCPower_UnlockSession at the end of your function without worrying about whether you actually have the lock, as the following example shows.
|
Returns
Reports the status of this operation. To obtain a text description of the status code, call niDCPower_error_message. To obtain additional information concerning the error condition, call niDCPower_GetError. The general meaning of the status code is as follows:
Value | Meaning |
|---|---|
0 | Success |
Positive Values | Warnings |
Negative Values | Errors |