niSwitch Initialize VI
- Updated2025-10-06
- 3 minute(s) read
Returns a session handle used to identify the switch module in all subsequent NI-SWITCH calls.
This VI creates a new IVI instrument driver session for the switch module specified in the resource name parameter. If multiple topologies are valid for that switch module, 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 this VI is called twice in the same process for the same resource with the same topology.
Related Topics

Inputs/Outputs
resource name
—
resource name specifies the instrument resource name assigned by Measurement & Automation Explorer (MAX) (for example, PXI1Slot3). IVI logical names are also valid resource names.
id query (boolean value)
—
id query is ignored. Because NI-SWITCH supports multiple switch modules, it always queries the switch module to determine which module is installed. For this reason, this VI may return an ID Query Failed error even if this parameter is set to VI FALSE.
reset device (boolean value)
—
reset device specifies whether to reset the switch module during initialization. The default value is TRUE (1). Note The first call to the niSwitch Initialize With Topology VI after you reboot your computer will reset the hardware. This is the only case when the Reset flag is not honored.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
instrument handle out
—
instrument handle out identifies a particular NI-SWITCH session established with the niSwitch Initialize With Topology VI, the niSwitch Initialize With Options VI, or the niSwitch Initialize VI and used for all subsequent NI-SWITCH calls.
error out
—
error out contains error information. This output provides standard error out functionality. |
resource name
—
id query (boolean value)
—
error in (no error)
—
instrument handle out
—
error out
—