niSwitch_CanConnect

NI-SWITCH Functions

niSwitch_CanConnect

IviSwtchBase Capability Group

C Function Prototype

ViStatus niSwitch_CanConnect (ViSession vi, ViConstString channel1, ViConstString channel2, ViInt32* pathCapability);

Purpose

Verifies that a path between channel1 and channel2 can be created.

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, a NISWITCH_WARN_IMPLICIT_CONNECTION_EXISTS warning is returned.

Parameters

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.

channel1 ViConstString Input one of the channel names of the desired path. Pass the other channel name as the channel2. Refer to Devices for valid channel names for the switch module.

Examples of valid channel names:

ch0, com0, ab0, r1, c2, cjtemp

The default value is an empty string.

channel2 ViConstString Input one of the channel names of the desired path. Pass the other channel name as channel1. Refer to Devices for valid channel names for the switch module.

Examples of valid channel names:

ch0, com0, ab0, r1, c2, cjtemp

The default value is an empty string.

pathCapability ViInt32 Indicates whether a path is valid.

Possible values include:

Value Description
NISWITCH_VAL_PATH_AVAILABLE Indicates that NI-SWITCH can create the path at this time.
NISWITCH_VAL_PATH_EXISTS Indicates that the path already exists.
NISWITCH_VAL_PATH_UNSUPPORTED Indicates that the instrument is not capable of creating a path between the channels you specify.
NISWITCH_VAL_RSRC_IN_USE Indicates that although the path is valid, NI-SWITCH cannot create the path at this moment because the switch is currently using one or more of the required channels to create another path. You must destroy the other path before creating this one.
NISWITCH_VAL_SOURCE_CONFLICT Indicates that the instrument cannot create a path because both channels are connected to different source channels.
NISWITCH_VAL_CHANNEL_NOT_AVAILABLE Indicates that NI-SWITCH cannot create a path between the two channels because one of the channels is a configuration channel and unavailable for external connections.