Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital triggered, synchronized AO, AI

How do I get the AO and AI to share a clock using DAQmx? I have a RTSI cable, but am not sure how to configure the devices. The output device will be stepping through an array of analog voltages at a predetermined rate. The input device will be scanning all channels for exactly the same duration of time that it takes to step through the voltage array.
0 Kudos
Message 1 of 5
(3,449 Views)
Hi,

You can use the "Export Signals" VI in the DAQmx Advanced Task Options pallette. Simply use the export signals vi to route your desired signal to the RTSI line in your master task. Then in your slave task, configure your sample clock to use the RTSI line. You can also export your AI_start_trigger to RTSI in your master task and have the slave task use it.

I have included an example of this.

-Sal
0 Kudos
Message 2 of 5
(3,433 Views)
While the example included by Sal will work, you can leverage the automatic routing feature of NI-DAQmx to avoid having to specify a RTSI line at all.

For example, in Sal's example, you can specify "Dev1/ai/SampleClock" as the source input to the "DAQmx Timing (Sample Clock)" VI rather than "Dev1/RTSI0." In addition, you can now remove the "DAQmx Export Signal (Most Signals) VI from the diagram. NI-DAQmx will automatically route the analog input sample clock signal to the analog output subsection of the device. I believe a RTSI line will still be used, but you don't need to explicitly specify a free one.

However, if you are using the same device for analog input and analog output, the "Multi-Function-Synch AI-AO-Ext Dig Trigger" example VI provides a more flexible solution. In this example, only the analog input start trigger is routed to the analog output start trigger (which I believe consumes a RTSI line). The analog input sample clock doesn't need to be routed to the analog output subsection since both sample clocks are derived from a shared master timebase. This example also allows the analog input and analog output operations to run at different rates.

If you are using two different devices for analog input and analog output, you need to route the master timebase as well as the analog input start trigger. The "Multi-Device Synch - Shared Timebase & ext Dig Trigger" example VI illustrates how to route the master timebase from one device to another. In this example, NI-DAQmx will automatically choose a RTSI line; you don't need to specify one. (Note that while this example is for synchronizing two devices performing analog input operations, it is still a good example of how to share the master timebase).

geoff
--
Geoff Schmit
Huskie Robotics, FIRST Team 3061 Lead Mentor
http://team3061.org/
@team3061
0 Kudos
Message 3 of 5
(3,428 Views)
I tried using the property nodes but kept getting error -200452. It seems my 6731 board will not work with them. I think Sal's example will work if I could get the AO and AI to trigger simultaneously, but I can't get it to work. Can you help me? Thanks.

Dave
0 Kudos
Message 4 of 5
(3,412 Views)
The problem here is that a 4472 is being used for AI, and the 4472 doesn't support the master timebase property. I posted a reply to this parallel thread that hopefully takes care of this issue.
0 Kudos
Message 5 of 5
(3,403 Views)