niDCPower_init
- Updated2025-10-06
- 2 minute(s) read
This function is deprecated. Use niDCPower_InitializeWithIndependentChannels instead.
Syntax
ViStatus _VI_FUNC niDCPower_init(ViRsrc resourceName, ViBoolean idQuery, ViBoolean resetDevice, ViSession *vi)
Remarks
Creates a new IVI instrument driver session to the device specified in resourceName and returns a session handle you use to identify the device in all subsequent NI-DCPower function calls. This function also sends initialization commands to set the device to the state necessary for the operation of NI-DCPower.
To place the device in a known start-up state when creating a new session, set resetDevice to VI_TRUE. This action is equivalent to using the niDCPower_reset function.
To open a session and leave the device in its existing configuration without passing through a transitional output state, set resetDevice to VI_FALSE, and immediately call the niDCPower_Abort function. Then configure the device as in the previous session, changing only the desired settings, and then call the niDCPower_Initiate function.
Parameters
| Name | Direction | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| resourceName | [in] | ViRsrc | Specifies the resourceName assigned by Measurement & Automation Explorer (MAX), for example "PXI1Slot3" where "PXI1Slot3" is an instrument's resourceName. resourceName can also be a logical IVI name. | ||||||
| idQuery | [in] | ViBoolean | Specifies whether the device is queried to determine if the device is a valid instrument for NI-DCPower. Defined Values:
| ||||||
| resetDevice | [in] | ViBoolean | Specifies whether to reset the device during the initialization procedure. Defined Values:
| ||||||
| vi | [out] | ViSession * | Returns a session handle that you use to identify the session in all subsequent NI-DCPower function calls. |
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 |