This function is deprecated. Use niDCPower_InitializeWithIndependentChannels instead.

Syntax

ViStatus _VI_FUNC niDCPower_InitWithOptions(ViRsrc resourceName, ViBoolean idQuery, ViBoolean resetDevice, ViConstString optionString, 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. With this function, you can optionally set the initial state of the following session attributes:

This function also sends initialization commands to set the device to the state necessary for NI-DCPower to operate.

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

NameDirectionTypeDescription
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.

resetDevice[in]ViBoolean

Specifies whether to reset the device during the initialization procedure.

optionString[in]ViConstString

Specifies the initial value of certain attributes for the session. The syntax for optionString is a list of attributes with an assigned value where 1 is VI_TRUE and 0 is VI_FALSE. Each attribute/value combination is delimited with a comma, as shown in the following example:

"Simulate=0,RangeCheck=1,QueryInstrStatus=0,Cache=1"

If you do not wire this input or pass an empty string, the session assigns the default values, shown in the example, for these attributes. You do not have to specify a value for all the attributes. If you do not specify a value for an attribute, the default value is used.

For more information about simulating a device, refer to Simulating an Instrument.

vi[out]ViSession *

Returns a handle that you use to identify the device 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