Connect(string, string)
- Updated2026-01-20
- 1 minute(s) read
Creates a path between channel1 and channel2.
Syntax
Namespace: NationalInstruments.ModularInstruments.NISwitch
public void Connect(string channel1, string channel2)
Parameters
| Name | Type | Description |
|---|---|---|
| channel1 | string | Indicates one of the channel name of the desired path. |
| channel2 | string | Indicates the name of the other channel name of the desired path. |
Exceptions
| Type | Description |
|---|---|
| Ivi.Swtch.ExplicitConnectionExistsException | The two channels are already explicitly connected by calling either the Connect or SetPath methods. |
| Ivi.Swtch.IsConfigurationChannelException | One of the channels is a configuration channel. |
| Ivi.Swtch.AttemptToConnectSourcesException | Both channels are connected to a different source. |
| Ivi.Swtch.CannotConnectToItselfException | channel1 and channel2 are one and the same channel |
| Ivi.Swtch.PathNotFoundException | Driver cannot find a path between the two channels. |
| Ivi.Driver.SelectorNameException | A repeated capability selector is expected, but the driver does not recognise the provided name. |
| Ivi.Driver.IviCDriverException | When an underlying IVI-C driver was called to perform an action, the IVI-C driver action did not succeed. |
| System.ObjectDisposedException | The Connect was accessed after the associated NISwitch object was disposed. |