NI Switches Help

Edition Date: April 2015

Part Number: 375472H-01

»View Product Info
Download Help (Windows Only)

Specific Function

C Function Prototype

ViStatus niSwitch_InitWithTopology (ViRsrc resourceName, ViConstString topology, ViBoolean simulate, ViBoolean resetDevice, ViSession* vi);


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


Name Type Description
resourceName ViRsrc

Resource name of the switch module to initialize.


Configured in MAX Under Valid Syntax
Devices and Interfaces DeviceName
Traditional NI-DAQ (Legacy) Devices SCXI[chassis ID]::slot number
PXI System PXI[bus number]::device number

Optional fields are shown in square brackets ([]). The default values for optional fields are as follows:

chassis ID = 1
bus number = 0

Tip  IVI logical names are also valid for the resource name.

Example resource names:

Name Description
SC1Mod3 NI-DAQmx module in chassis "SC1" Slot 3
MySwitch NI-DAQmx module renamed to "MySwitch"
SCXI1::3 Traditional NI-DAQ (Legacy) module in chassis 1, Slot 3
SCXI::3 Traditional NI-DAQ (Legacy) module in chassis 1, Slot 3
PXI0::16 PXI bus 0, device number 16
PXI::16 PXI bus 0, device number 16
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.
Note  To determine the names of the supported topologies for your switch device, expand the Devices book, and select the switch module you are using from the Contents tab of this help file. In the device overview, the Operation Modes table(s) lists all supported topology and software names for the switch module.
simulate ViBoolean Enables simulation of the switch module specified in the resourceName parameter.
Value Description
VI_TRUE Simulate
VI_FALSE (default) Do not simulate
resetDevice ViBoolean Specifies whether to reset the switch module during the initialization process.
Value Description
VI_TRUE (default) Reset device
VI_FALSE The device will not reset.
Note  The first call to niSwitch_InitWithTopology, after you reboot your computer, will reset the hardware. This is the only case when the Reset flag is not honored.
vi ViSession A particular NI-SWITCH session established with niSwitch_InitWithTopology, niSwitch_InitWithOptions, or niSwitch_init and used for all subsequent NI-SWITCH calls.

Related Information


Not Helpful