Program C Series Relay Output Module with DAQmx

Updated Dec 19, 2023

Environment

Hardware

  • NI-9482
  • NI-9481
  • NI-9485

Software

  • LabVIEW

Driver

  • NI-DAQmx

The NI 948x is a digital output relay module controlled with boolean commands.  When a True value is written to a channel, the relay is closed and the terminal that is connected to the load allows current to flow or allows voltage to be applied to the load. When a False value is written to a channel, the switch opens, disconnecting the circuit so no current flows and no voltage is applied to the load. This article will go through programming a C Series Relay Output Module with DAQ Assistant and the DAQmx LabVIEW API. Each example details closing the relay on channels 0-2 and opening the relay on channel 3.

DAQ Assistant

  1. Open LabVIEW.
  2. Go to the Block Diagram.
  3. Place the DAQ Assistant onto the block diagram. 
  4. The Create New Express Task dialog will display. Expand Generate Signals»Digital Out to select either Line Output or Port Output.
    • port output uses one channel for all lines.
    • line output uses one channel for each line.
  5. Use the radio buttons as indicated in the images below to define the boolean state. 

Figure 1: Configure 4 Channels on the NI 948x for Line Output

 

Figure 2: Configure 4 Channels on the NI 948x for Port Output


Figure 3: Configure 4 Channels on the NI 948x for Port and Line Output


DAQmx LabVIEW API

  1. Open LabVIEW.
  2. Go to the Block Diagram.
  3. Use a DAQmx Create Virtual Channel.vi  to select your device and physical channels.
  4. Use a DAQmx Write.vi to control the states of the relay.