CanConnect(string, string)
- Updated2026-01-20
- 1 minute(s) read
Verifies that you can create a path between channel1 and channel2.
Syntax
Namespace: NationalInstruments.ModularInstruments.NISwitch
public SwitchPathCapability CanConnect(string channel1, string channel2)
Remarks
If a path is possible in the switch module, the availability of that path is returned given the existing connections. If the path is possible but in use, an ImplicitConnectionExistsWarningCode warning is returned.
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. |
Returns
Returns a SwitchPathCapability object indicating whether a path is valid.
Exceptions
| Type | Description |
|---|---|
| System.ObjectDisposedException | The CanConnect was accessed after the associated NISwitch object was disposed. |