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