06-02-2008 10:36 AM
06-03-2008 10:33 AM
06-03-2008 10:37 AM
Hello bv23,
You have nearly everything setup correctly for this to work you just need to change one of two things:
1. If both analog input and analog output tasks are going to be running at the same rate then you can just modify the DAQmxCfgSampClkTiming source for the analog output to be the analog input sample clock. Then, as long as you start the analog output task first they will be synchronized because even if the analog output is started before the analog input the sample clock won't be available until the analog input is also started.
1. If you want to run both tasks as different rates (though this also works if they run at the same rate). What you need to do is add a DAQmxCfgDigEdgeStartTrig call to the analog output task and choose the source as the Dev1/aiStartTrigger (where "Dev1" is your device name). Then, once again you start the analog output task with the DAQmxStartTask call and it will then be waiting for the internal digital edge generated by the DAQmxStartTask call to the analog input. This will effectively synchronize the start of your two tasks and let you use different (or the same) sample clocks.
Either of these methods will allow you to synchronize your two tasks without using the external digital trigger. Feel free to post back if you have any questions about how to implement these solutions.
Cheers,