Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
2 ratings:
 4.5 out of 5     Rate this Document

What Functions Do I Use to Operate My Compact DAQ (cDAQ) Relay Module?

Primary Software: Driver Software>>NI-DAQmx
Primary Software Version: 8.6.1
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: CompactRIO>>Digital Output Modules>>NI 9481, CompactDAQ>>Digital Output Modules>>NI 9485

Problem:
I have a cDAQ relay module and want to know what functions I can use with it. I have DAQmx Switches functions. Can I use them with my module?

Solution:
You cannot use DAQmx Switches functions to operate your cDAQ relay module. Instead, use the DAQmx Write (Digital 1D Bool NChan 1Samp 1Line) function.

For example, if you want to configure all 4 lines on a NI-9481 relay, perform the following steps:
  1. First create a task in Measurment and Automation Explorer (MAX) and add all 4 channels on the cDAQ module to the task by Generate Signals -> Digital Input -> Line Output ->NI 9481 -> select all four channels
  2. Navigate to LabVIEW and place a DAQmx Task Name Constant on the block diagram.
  3. Select the task that you have made, then right-click the DAQmx Task Name and select Generate Code»Configuration. This will automatically generate a VI which contains the code needed to configure the channels related to the task.
  4. Wire the new VI to a DAQmx Write (Digital 1D Bool NChan 1Samp 1Line) function.
  5. Wire a constants to the auto start input terminal and data input terminal on this VI by right-clicking the terminals and selecting Create»Constant. Expand the data input constant array to match the number of channels in the task. Verify that the auto start constant is set to true.After these steps, the VI created should look like the VI pictured in Figure 1.

Figure 1: Configure 4 Channels on the NI-9481

There are 4 channels configured in the task and therefore there are 4 elements in the data array. The first Boolean constant applies to the first channel configured in the task; the second Boolean constant applies to the second channel configured in the task and so on. If the Boolean constant value is true, the switch on the corresponding relay will close. If the Boolean constant value is false, the switch on the corresponding relay will open. This is illustrated in Figure 2.

Figure 2: Impact of a DAQmx Write on the NI-9481


Related Links:
KnowledgeBase 4D3F2P9S: How Do I Check the Status of the Relays on My NI 948x Compact DAQ Relay Module?

Attachments:


configure switch state.jpgexampleVI.jpg


Report Date: 12/22/2006
Last Updated: 05/11/2009
Document ID: 44LAPTNP

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit