niDCPower_InitWithOptions

NI-DCPower Function Reference

niDCPower_InitWithOptions

ViStatus niDCPower_InitWithOptions (ViRsrc resourceName, ViBoolean IDQuery, ViBoolean resetDevice, ViString optionString, ViSession *newVi);

Purpose

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. To apply a new configuration without disrupting the output channels of the device, configure the device in Delayed Configuration mode as in the previous session changing only the desired settings, and then call the niDCPower_Initiate function.

Parameters

Input
Name Type Description
resourceName 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 ViBoolean Specifies whether the device is queried to determine if the device is a valid instrument for NI-DCPower. The default value is VI_TRUE.

resetDevice ViBoolean Specifies whether to reset the device during the initialization procedure. The default value is VI_TRUE.


optionString ViString 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 a Power Supply or SMU.

Output
Name Type Description
newVi ViSession* Returns a handle that you use to identify the device in all subsequent NI-DCPower function calls.

Return Value

Name Type Description
StatusViStatusReports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.