**Note: This page includes switch code written with the switching palette of the NI-DAQmx driver. In the past, you were able to program NI switches with either the NI-DAQmx or NI-SWITCH driver. As of 2015, the NI-DAQmx switching palette is not recommended for new designs and NI strongly recommends using the NI-SWITCH driver for new designs. For more information, please review the following document: What Drivers Can I Use to Program My NI Switch Modules?
This example demonstrates how to connect and disconnect two channels on a switch module.
Instructions for Running:
1. Change Switch Device Name and Topology Name as necessary.
2. Change Switch Channel 1 and Switch Channel 2 to valid channel names for your switch module.
The Switch Channels I/O Name control lists the valid channels for the topology in which the switch module was last set. To list channels for another topology, reset the switch module to the new topology.
Refer to the NI Switches Help for the valid channel names for your switch module.
Block Diagram Steps:
1. Set topology.
2. Connect specified channels.
3. Wait for relay(s) to activate and debounce.
4. Disconnect specified channels.
5. Wait for relay(s) to activate and debounce.
6. Display errors (if any).
I/O Connections Overview:
Refer to the NI Switches Getting Started Guide and NI Switches Help for information about connecting signals to your switch module.