Example Code

NI SwitchBlock: NI-SWITCH 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


  • Other

Code and Documents



This code uses NI-SWITCH VIs to establish an explicit path connection from one column to another in an NI SwitchBlock device.



The VI first initializes your NI SwitchBlock device and configures it for the topology you specify.  It then makes the connections that you define in the connections list on the front panel.  After waiting for the switch to close, the VI terminates the NI-SWITCH session and handles any errors.


Refer to the NI Switches Getting Started Guide and NI Switches Help for valid channel names and information about connecting signals to your switch module.




     LabVIEW 2012(or compatible)

     NI-SWITCH 4.6 (or compatible)


     NI SwitchBlock



Steps to Implement or Execute Code

     1.  Select your NI SwitchBlock device name and 'Configured Topology'

     2.  Select the connections that you want to make between your devices

     3.  Run the VI.  The connections specified in your list will be made



Additional Information or References

Block Diagram


**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.