06-11-2010 07:59 PM
Hello all,
I am having trouble synchronizing the start of an analog and ditigal output task in C#. Specitifically, I have created a master analog output task and a slave digital output task that uses the AO Task's sample clock. Everything works fine except there is always a random delay between the signals because they are triggered to start separately in software. I would like to start both tasks with the same trigger signal.
I think that I need to do something like:
digitalTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("Dev2/ao/StartTrigger",DigitalEdgeStartTriggerEdge.Rising);
analogTask.Start();
but DAQmx is throwing an error saying that my tigger source is not valid. Is this the correct idea? What is the exact syntax for inputing the trigger source. Thanks much for any help!!!
-Jon
Solved! Go to Solution.
06-14-2010 12:28 PM
Hi Jon-
If you have the sample clock shared across both tasks, you should be able to just start the slave task first, that way when the master task starts, the slave task will start taking samples on the same clock edge. You shouldn't have to use a start trigger.
However, if you are trying to import an external trigger, you would hook it up to a PFI line and specify "Dev2/PFI0" as the trigger source for both tasks (or whichever PFI line you have hooked the trigger up to).
I hope this helps. Best of luck with your application!
06-14-2010 08:45 PM
Yup that did it.
Thank you Gary!
-Jon