Skip navigation


Currently Being Moderated

Switch - Controlling Individual Relays (DAQmx).vi

VERSION 2  Click to view document history
Created on: Nov 13, 2012 6:25 PM by NEWKlear - Last Modified:  Jun 20, 2016 12:50 PM by example_scrub

**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 control an individual relay on a switch module.


Instructions for Running:


To make this example work with your switch, complete the following:

1 - Change Switch Device Name and Topology Name as necessary.

2 - Change Relay Name to the name of a valid relay on the switch module.

3 - Change Relay Action to choose whether to open or close the relay.


The Switch Relays I/O Name control lists the valid relays for the topology in which the switch module was last set.  To list relays for another topology, reset the switch module to the new topology.


Refer to the Switches Help for the valid relay names and valid device names for your switch module.


Block Diagram Steps:


1 - Reset the switch and set the topology.

2 - Open or close the relay.

3 - Wait for the relay to activate and debounce.

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


Block Diagram:


Switch - Controlling Individual Relays (DAQmx).png

Comments (0)