This function is deprecated. Use niDCPower_InitializeWithIndependentChannels instead.

Syntax

ViStatus _VI_FUNC niDCPower_InitializeWithChannels(ViRsrc resourceName, ViConstString channels, ViBoolean reset, ViConstString optionString, ViSession *vi)

Remarks

Creates and returns a new NI-DCPower session to the instrument specified in resource name to be used in all subsequent NI-DCPower function calls. With this function, you can optionally set the initial state of the following session attributes:

After calling this function, the session will be in the Uncommitted state. Refer to the Programming States topic for details about specific software states.

To place the device in a known start-up state when creating a new session, set reset to VI_TRUE. This action is equivalent to using the niDCPower_reset function immediately after initializing the session.

To open a session and leave the device in its existing configuration without passing through a transitional output state, set reset to VI_FALSE. Then configure the device as in the previous session, changing only the desired settings, and then call the niDCPower_Initiate function.

Related Topics:

Programming States

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.

channels[in]ViConstString

Specifies which channel(s) to include in a new session. Specify multiple channels by using a channel list or a channel range. A channel list is a comma (,) separated sequence of channel names (for example, 0,2 specifies channels 0 and 2). A channel range is a lower bound channel followed by a hyphen (-) or colon (:) followed by an upper bound channel (for example, 0-2 specifies channels 0, 1, and 2). In the Running state, multiple channel configurations are performed sequentially based on the order specified in this parameter. If you do not specify any channels, by default all channels on the device are included in the session.

reset[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. For example:

"Simulate=0"

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 session 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