NI Switches Help

Edition Date: April 2015

Part Number: 375472H-01

»View Product Info
Download Help (Windows Only)

C Function Prototype

ViStatus niSwitch_ConnectMultiple (ViSession vi, ViConstString connectionList);


Creates the connections between channels specified in connection list. Specify connections with two endpoints only or the explicit path between two endpoints. NI-SWITCH calculates and uses the shortest path between the channels. Refer to Setting Source and Configuration Channels for information about channel usage types. In the event of an error, connecting stops at the point in the list where the error occurred.

If a path is not available, the function returns one of the following errors:

  • NISWITCH_ERROR_EXPLICIT_CONNECTION_EXISTS, if the two channels are already connected.
  • NISWITCH_ERROR_IS_CONFIGURATION_CHANNEL, if a channel is a configuration channel. Error elaboration contains information about which of the two channels is a configuration channel.
  • NISWITCH_ERROR_ATTEMPT_TO_CONNECT_SOURCES, if the connection between two channels is connected to different source channels. Error elaboration contains information about the connection channel with errors.
  • NISWITCH_ERROR_CANNOT_CONNECT_TO_ITSELF, if two channels in a single connection are the same channel.
  • NISWITCH_ERROR_PATH_NOT_FOUND, if the driver cannot find a path between two channels.
Note Note  Paths are bidirectional. For example, if a path exists between channels ch1 and ch2, then the path also exists between channels ch2 and ch1.


Name Type Description
vi ViSession A particular NI-SWITCH session established with niSwitch_InitWithTopology, niSwitch_InitWithOptions, or niSwitch_init and used for all subsequent NI-SWITCH calls.

connectionList ViConstString Connection list specifies a list of connections between channels to make. NI-SWITCH validates the connection list, and aborts execution of the list if errors are returned. Refer to Connection and Disconnection List Syntax for valid connection list syntax and examples. Refer to Devices for valid channel names for the switch module.

Related Information


Not Helpful