Example Code

NI SwitchBlock: DAQmx Example for Single Device Explicit Path 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 VI will make an explicit path connection from one column to another in an NI SwitchBlock device using NI-DAQmx


This VI accomplishes the following tasks during execution. The numbers in the sequence below correspond to the numbers on the block diagram.

1.Resets a switch device and sets its topology to the one you specify in Topology Name.

2.Makes multiple connections from one column to another as specified in the connection list on the front panel, and waits for the switch to finish closing.

3.Handles any errors that have occurred.

For I/O connection diagrams and information, refer to the NI Switches Getting Started Guide and NI Switches Help for information about connecting signals to your switch module..



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


    1. NI SwitchBlock Module

Steps to Implement or Execute Code

  1.  Select your NI SwitchBlock device name, and ‘Configured Topology’
  2. Select the list of connections that you would want to make in the Connection List
  3. Run the VI and the connections will be made as specified in your list of connections
  4. Refer to the NI Switches Help for the valid channel names for your switch module


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.