Example Code

NI SwitchBlock: DAQmx Example for Multiple Device Endpoint Connections

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.


  • Modular Instrumentation


  • LabVIEW


  • NI DAQmx

Code and Documents



This code uses NI-DAQmx to make an endpoint connection from one column to another in multiple NI SwitchBlock devices.


The example VI performs the following steps:

  1. Resets both switch devices and sets their topology to the one you specify in Topology Name
  2. Creates an array of row names and an array of analog bus names for your specific device
  3. Reserves all of the rows for routing in preparation to connect over these rows on your NI SwitchBlock device
  4. Allows the sharing of your analog bus over multiple devices
  5. Makes a connection from one column to another and waits for the switch to finish closing
  6. Handles errors




    1. LabVIEW 2012 (or compatible)
    2. NI-DAQmx 9.3.5


    1. NI SwitchBlock Module

Steps to Implement or Execute Code

  1. Download and unzip the NI-DAQmx 2 Device Endpoints.zip file
  1. For each device configure the following in the front panel:
  • Select your NI SwitchBlock device name
  • Select 'Configured Topology' for the Topology Name
  • Select your column to connect
  • Select your analog bus to use in this connection. The same analog bus should be selected for both.
  1. Run the VI. The connections between the two devices will be made.


Additional Information or References

VI Snippet



**This document has been updated to meet the current required format for the NI Code Exchange.**


National Instruments
Software Group Manager

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.