This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Program C Series Relay Module with DAQmx

Updated Sep 11, 2019

Reported In


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


  • LabVIEW


  • NI-DAQmx

Issue Details

I have a C Series relay module in the 948x family, and I want to program it to provide a digital output using either DAQmx tasks or DAQ Assistant. How can I do this?


This can be done via interactive configuration with the DAQ Assistant or with DAQmx API functions. The relays can be configured as a line or port.
Figure 1: Relay Configuration Used in DAQ Assistant and DAQmx API Examples Below
In DAQ Assistant
  1. Place the DAQ Assistant onto the block diagram. 
  2. The Create New Express Task dialog will display. Expand Generate Signals»Digital Out to select either Line Output or Port Output.
    • A port output uses one channel for all lines.
    • A line output uses one channel for each line.
  3. Use the radio buttons as indicated in the images below to define the boolean state.
Figure 2: Configure 4 Channels on the NI 948x for Line Output

Figure 3: Configure 4 Channels on the NI 948x for Port Output
  1. Create a Digital Output channel. Select the appropriate Line Grouping for either port or line output.
  2. Write the data as an array of boolean constants to the DAQmx Write VI. In this example, a True value is defined for the Auto Start parameter, which eliminates the need of the DAQmx Start VI.

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

Additional Information

How are relay modules programmed in 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.  The image below is the NI 948x in an open or boolean False state.

Figure 5: NI 948x in an Open or boolean False state