niSwitch Initialize With Topology

NI-SWITCH LabVIEW

niSwitch Initialize With Topology

Returns a session handle used to identify the switch module in all subsequent NI-SWITCH calls and sets the topology of the switch module.

niSwitch Initialize with Topology creates a new IVI instrument driver session for the switch module specified in the resource name parameter. NI-SWITCH uses the topology specified in the topology name 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 True.

resource name specifies the resource name of the switch module to initialize.

Syntax:

Optional fields are shown in square brackets ([]).

MAX Configuration Pane CategoryValid Syntax
NI-DAQmx Devices DAQmxDeviceName
Traditional NI-DAQ (Legacy) DevicesSCXI[chassis ID]::slot number
PXI System PXI[bus number]::device number
Tip  IVI logical names are also valid for resource name.

Default values for optional fields:

  • chassis ID = 1
  • bus number = 0

The following table lists example resource names:

Resource NameDescription
SC1Mod3NI-DAQmx module in chassis "SC1" Slot 3
MySwitchNI-DAQmx module renamed to "MySwitch"
SCXI1::3Traditional NI-DAQ (Legacy) module in chassis 1, Slot 3
SCXI::3Traditional NI-DAQ (Legacy) module in chassis 1, Slot 3
PXI0::16PXI bus 0, device number 16
PXI::16PXI bus 0, device number 16
topology name specifies the topology to use for the switch module specified in resource name. Create a control for topology name to select from a list of topologies.

reset device specifies whether to reset the switch module during the initialization process.

TRUE (default)The device will reset.
FALSEThe device will not reset.
Note  The first call to niSwitch Initialize with Topology, after you reboot your computer, will reset the hardware. This is the only case when the Reset flag is not honored.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurs before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a non-zero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

simulate enables simulation of the switch module specified in resource name.

TRUEThe module will be simulated.
FALSE (default)The module will not be simulated.

If simulate is TRUE, the module and topology specified in topology name is simulated. If topology name is not specified, the module specified in the resource name is simulated.

instrument handle out identifies a particular NI-SWITCH session established with niSwitch Initialize With Topology, niSwitch Initialize With Options or niSwitch Initialize and used for all subsequent NI-SWITCH calls.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a non-zero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.