Table Of Contents

Connection and Disconnection List Syntax

Last Modified: September 15, 2017

Use connection lists and disconnection lists with DAQmx Switch Connect (Multiple) and DAQmx Switch Disconnect (Multiple), respectively. These function/VI list parameters use a rich and versatile syntax to describe the operation that the function/VI performs. Because these lists use the same syntax, they are referred to here as connection lists for simplicity. The connection list syntax is similar to the switch scanlist syntax with few exceptions.

Connection/disconnection lists are strings composed of one or more switching operations. For those lists that contain multiple operations, commas separate each operation:

Operation1, Operation2, Operation3

Switching operations can connect/disconnect channels in one of two ways:

  • Specify the endpoints. When you specify the endpoints, NI-DAQmx searches for an available path between the endpoints to connect/disconnect. The syntax for specifying the endpoints is as follows:

    channel1 -> channel2

    where the channel names of a switch are separated by an arrow (->).

    The two specified channels must reside on the same device and an available path between them must exist. If the path between the two channels includes one or more channels, these intermediate channels should have their usage mode marked as "reserved for routing."

    For example, if a path exists between channel0, com0, and AB0, it is possible to connect channel0 to AB0 by marking the usage mode of com0 as "reserved for routing." The operation in the string would appear as the following:

    channel0 -> AB0

    When multiple intermediate channels exist and their usage is marked as "reserved for routing," NI-DAQmx selects the intermediate channel to use.

  • Specify an explicit path. When you specify an explicit path, you define the endpoints as well as any intermediate channels of the path. Specifying an explicit path can be useful in applications in which you have calibrated your system based on a specific path through the switch.

    The syntax for specifying an explicit path is as follows:

    [channel1 -> channel2 -> channel3]

    For example, if you want to connect column 1 and column 5 of a matrix and use row 2 to complete that connection, you would have to mark the usage of row 2 as "reserved for routing" and use the following string:

    [c1 -> r2 -> c5]

The following is additional information on connection and disconnection lists:

  • A connection/disconnection list string can contain switching operations on different switch modules. To do so, add the switch name and a / before the operation. Refer to the following example.

    Switch1/ch1 -> com0 , [switch2/c0 -> r2 -> c5] , switch3/r0 -> c4

  • Before execution, NI-DAQmx validates the connection/disconnection list. If any errors are returned, NI-DAQmx aborts execution of the list.
  • The order of the operations in the connection/disconnection list does not guarantee their order of execution. To ensure a specific order, use multiple connection/disconnection lists.
  • NI-DAQmx ignores any white space, and inputs are not case sensitive. You can use spaces and carriage returns to improve readability.

Recently Viewed Topics