Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

Triggering a Analog input based on a Digital output cDAQ modules


I'm using a cDAQ chassis 9178 with a NI9205 AI and a NI9402 Digital module. What I'm trying to do is sync a DO line to trigger a AI channel to start a acquisition on the edge trigger. I have looked at various examples but I'm not finding anything that this can be done. I'm using LabView. Can this be done with the 9178 chassis to sync events between modules? Without using another AI to read the value of the DO line back as feedback?


Ultimately I want to put them both on a waveform graph to capture the response time of a DUT to the switching of the port.



Bill Lewis
0 Kudos
Message 1 of 7

Hi Bill,


You should be able to synchronize the two tasks by configuring both to share the same clock and start trigger.  There's a shipping example that shows one way you might do this in LabVIEW under Help >> Find Examples..., called Hardware Input and Output >> DAQmx >> Synchronization >> Analog Input -


This example shows two analog input tasks synchronized, but the basic process should be the same to set a digital channel to share the AI clock and trigger.

You can find more details about DAQmx task synchronization in this tutorial:  The sections on start trigger and sample clock synchronization will be most relevant.



Michael B.
Product Support Engineer
National Instruments
0 Kudos
Message 2 of 7

Still working on this project. I want to start a AI read when a signal is detected on a digital port and then combine the signals so that I can measure the timing between the digital input and the slope received on the AI waveform. I would like use the internal sync of the CDAQ module or monitor the input of the signal to trigger the AI. I'm using the CDAQ 9178, DI 9425 (24V), and NI9205 module. since the 9425 is a 24V input I cant wire it back to the 9205 trigger input directly. This is why I want to do the above. all of the examples show two AI signals not a DI to AI.

Bill Lewis
0 Kudos
Message 3 of 7

Hi Bill,


I misunderstood.  I thought you wanted the two tasks to start at the same time, and take samples at the same rate.  If you'd like to use the digital input like a trigger for the AI task, I'm afraid that's not directly possible with a cDAQ chassis.  Triggers can only be configured using chassis or module PFI lines, which as you note, have different voltage limits than your DI module.


If you are trying to put the two signals onto a single chart to measure timing between them, the best way may be to configure the two tasks as I suggested in my last post.  That is, make the AI task use the start trigger and sample clock of the DI task.  That would guarantee that the two tasks start at the same time, and take samples at the same time, allowing you to reasonably compare the two signals.  You'd still see a slight skew due to the routing of the trigger and clock through the cDAQ backplane, but depending on your requirements that may be tolerable.


The process will be the same as synchronizing two AI tasks in our examples, just with the DI task swapped for the master AI task.

Michael B.
Product Support Engineer
National Instruments
0 Kudos
Message 4 of 7

Which sync type should I use in the example, all are giving errors with the CDAQ module? Also when I change the master task to a digital task it will not allow me to select the NI 9476 output module as a digital output. Cam this be done between a 9476 and a 9205? Little confused on what needs to happen

Bill Lewis
0 Kudos
Message 5 of 7

I have modified it to look like what I think it should do. The task BT_Out_AddAir is a task in Max for controlling the digital output. Not sure if the ai/startTrigger is correct but when I run it I get an error 


Error -89131 occurred at DAQmx Start


Possible reason(s):

An attempt has been made to perform a route when the source and the destination are the same terminal.

In many cases, such as when configuring an external clock or a counter source, you must select a PFI, PXI Trigger, or RTSI line as the source terminal.

Property: Start.DigEdge.Src
Property: Start.DigEdge.Edge
Source Device: cDAQ1
Source Terminal: ai/StartTrigger

Task Name: _unnamedTask<1A>

Bill Lewis
0 Kudos
Message 6 of 7

The important stuff is hidden inside the subvi that does some config for your DO task.  Odds are, you'd need to specify "do/StartTrigger" as the signal you wish to export out from the DO task over to the AI task.


However, your original message makes it sound like you may want to trigger AI *not* from the start of the DO task, but when one of the DO *signals* changes state.   I don't know the cDAQ hardware, but perhaps a very-low-current-draw voltage divider would let you bring the DO signal back into an input that lets it be used as a trigger signal for AI?



-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).

0 Kudos
Message 7 of 7