08-08-2008 06:28 PM
08-11-2008 07:35 PM
Hi zientist,
It seems as though some of the errors you are getting are due to errors in your DAQmx sequence. You had the correct idea in that you have to share a start trigger and sample clock, however, the order in which the various tasks were started needed correction. In your example, since you are using AI Start Trigger to trigger the different tasks, you must ensure that the other tasks have already been configured and ready to receive this trigger source. Currently in your code, you have made it such that the different tasks start independently of each other and without proper data flow, LabVIEW cannot guarantee the order of execution between the tasks and this may have cause many of your problems. In order to control the execution order, you can do so by appropriately connecting the error handling wires such that your DO & AO tasks start before the AI task since in LabVIEW, a VI will not execute until all of its inputs are ready.
Another thing to note is that since both DI & DO do not have explicit start triggers, in order to synchronize a digital acquisition/generation task, you can simply use the AI Start Trigger to begin generating AI sample clock and use it to clock your digital timing. More information on this can be found in your M-Series Manual in page 6-3.
You can also use our website for more information regarding synchronization in M-Series devices.
M Series Synchronization with LabVIEW and NI-DAQmx
I have modified your code with the necessary changes so we can get you started in the right direction. I hope this helps,
08-12-2008 11:56 PM
08-13-2008 02:35 PM
Hi zientist,
Here's the same code written in 8.2. Please let us know if you have any question.
08-13-2008 05:17 PM
Hi S_Hong,
Thanks for your reply and sending the 8.2 version file.
I understand what you mean. I have a question though. Since you said that it is imperative to have the output signal ready to go when the input trigger is connected (I know you meant use the errors to do that), but is the following VI appropriate (attached). Because even if I don't link the errors, as long as i trigger the analogue output signal after the signal is generated it seems to work fine. Is there something wrong in this logic?
Zientist
08-14-2008 05:14 PM
Hi zientist,
To reiterate, since you will be triggering you analog output off of the AI start trigger, you will need to finish configuring and start your AO task so that it is ready to receive the AI trigger. So in other words, you will need to start your AO task before your AI task. As long as you can ensure this, you will not have any problems.