niSwitch_init
Specific Function
C Function Prototype
ViStatus niSwitch_init (ViRsrc resourceName, ViBoolean idQuery, ViBoolean resetDevice, ViSession* vi);
Purpose
Returns a session handle used to identify the switch module in all subsequent instrument driver calls.
niSwitch_init creates a new IVI instrument driver session for the switch module specified in the resourceName parameter. If multiple topologies are valid for that device, NI-SWITCH uses the default topology specified in MAX.
By default, the switch module is reset to a known state.
An error is returned if a session to the specified resource exists in another process. The same session is returned if niSwitch_init is called twice in the same process for the same resource with the same topology.
Parameters
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resourceName | ViRsrc | Resource name of the switch module to initialize. Syntax:
Optional fields are shown in square brackets ([]). The default values for optional fields are as follows: chassis ID = 1
Example resource names:
|
||||||||||||||||||||||||
idQuery | ViBoolean | This parameter is ignored.
Because NI-SWITCH supports multiple switch modules, it always queries the switch to determine which device is installed. For this reason, this VI may return NISWITCH_ERROR_FAIL_ID_QUERY even if this parameter is set to VI_FALSE.
|
||||||||||||||||||||||||
resetDevice | ViBoolean | Specifies whether to reset the switch module during the initialization process.
|
||||||||||||||||||||||||
vi | ViSession | A particular NI-SWITCH session established with niSwitch_InitWithTopology, niSwitch_InitWithOptions, or niSwitch_init and used for all subsequent NI-SWITCH calls. |