niSwitch_InitWithTopology
- Updated2023-02-21
- 3 minute(s) read
Specific Function
C Function Prototype
ViStatus niSwitch_InitWithTopology (ViRsrc resourceName, ViConstString topology, ViBoolean simulate, ViBoolean resetDevice, ViSession* vi);
Purpose
Returns a session handle used to identify the switch module in all subsequent instrument driver calls and sets the topology of the switch module.
niSwitch_InitWithTopology creates a new IVI instrument driver session for the switch module specified in the resourceName parameter. The driver uses the topology specified in the topology parameter and overrides the topology specified in MAX.
![]() |
Note When initializing an NI SwitchBlock device with topology, you must specify the topology created when you configured the device in MAX, using either NISWITCH_TOPOLOGY_CONFIGURED_TOPOLOGY or the topology string of the device. Refer to Initializing with Topology for NI SwitchBlock Devices for information about determining the topology string of an NI SwitchBlock device. |
By default, the switch module is reset to a known state.
Enable simulation by specifying the topology and setting the simulate parameter to VI_TRUE.
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:
|
||||||||||||||||||
topology | ViConstString | Pass the topology name you want to use for the switch you specify with the resourceName parameter. You can also pass NISWITCH_TOPOLOGY_CONFIGURED_TOPOLOGY to use the last topology that was configured for the device in MAX.
|
||||||||||||||||||
simulate | ViBoolean | Enables simulation of the switch module specified in the resourceName parameter.
|
||||||||||||||||||
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. |