niSwitch_InitWithTopology

NI-SWITCH Functions

niSwitch_InitWithTopology

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.

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:

MAX Configured under Valid Syntax
NI-DAQmx Devices DAQmxDeviceName
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.
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.