niDCPower_InitializeWithIndependentChannels
- Updated2023-04-15
- 3 minute(s) read
ViStatus niDCPower_InitializeWithIndependentChannels(ViRsrc resourceName, ViConstString channels, ViBoolean reset, ViConstString optionString, ViSession *vi);
Purpose
Creates a new NI-DCPower session to the specified instrument(s) and channel(s) and returns a session handle to be used in all subsequent NI-DCPower function calls.
After calling this function, the specified channel or channels will be in the Uncommitted state.
With this function and channel-based NI-DCPower functions and attributes, you can use any channels in the session independently. For example, you can initiate a subset of channels in the session with niDCPower_InitiateWithChannels, and the other channels in the session remain in the Uncommitted state.
Details
Details of Independent Channel Operation
When you initialize with independent channels, each channel steps through the NI-DCPower programming state model independently of all other channels, and you can specify a subset of channels for most operations.
![]() |
Note You can make concurrent calls to a session from multiple threads, but the session executes the calls one at a time. If you specify multiple channels for a function or attribute, the session may perform the operation on multiple channels in parallel, though this is not guaranteed, and some operations may execute sequentially. |
Related Topics:
Parameters
Input | ||
Name | Type | Description |
resourceName | ViRsrc | Specifies the NI-DCPower resources to use in the session. NI-DCPower resources can be names of the instrument(s) assigned by Measurement & Automation Explorer (MAX) and the channel(s) to initialize. Specify the instrument(s) and channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.
If you pass "" for this control, all channels of the instrument(s) are included in the session. |
reset | ViBoolean | Specifies whether to reset channel(s) during the initialization procedure. The default is VI_FALSE.
To place channel(s) in a known startup state when creating a new session, set reset to VI_TRUE. This action is equivalent to using the niDCPower_ResetWithChannels function immediately after initializing the session. To open a session and leave the channel(s) in an existing configuration without passing through a transitional output state, set reset to VI_FALSE. Next, configure the channel(s) as in the previous session, change the desired settings, and then call the niDCPower_InitiateWithChannels function to write both settings. |
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. For example:
Simulate=0, DriverSetup=Model:<model number>; BoardType:<bus connector>
To simulate a multi-instrument session, set Simulate to 1 and list multiple instruments for DriverSetup. For example: Simulate=1, DriverSetup=ResourceName:<instrument name>; Model:<model number>; BoardType:<bus connector> & ResourceName:<resource name>; Model:<model number>; BoardType:<bus connector> 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 |
vi | ViSession* | Returns a session handle that you use to identify the session in all subsequent NI-DCPower function calls. |
Return Value
Name | Type | Description |
Status | ViStatus | Reports 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. |