05-22-2009 12:40 PM
I have two writes on the same channel, when i use the light bulb the signal works properly. When the vi runs at full speed it never sends the second write.
Solved! Go to Solution.
05-22-2009 12:45 PM
05-26-2009 10:26 AM
Hi mike_fit,
By default, DAQmx will regenerate Analog Output data from a buffer in PC memory (see the KnowledgeBase Analog Output Regeneration Modes for more info). I'm not sure if this is causing the problem, but I believe what is likely happening is that you are stopping the task before the new data is output on the card--in this case the DAQ device would still be outputting the original data.
When Highlight Execution is enabled this slows down execution long enough to write the new data and output it before the task is stopped. Restarting the task would clear the old data from the buffer, which would explain why doing so fixes the problem.
From the looks of the program it seems like you are writing a single voltage update to your analog output line. For an application such as this, you shouldn't need to use buffered output since you are writing one value to the DAQ device per DAQmx Write call. In your case I would recommend not using buffered analog output and just stick with Software-Timed updates. The following shipping example shows what this might look like:
Help >> Find Examples... >> Hardware Input and Output >> DAQmx >> Analog Generation >> Voltage >> Gen Mult Volt Updates-SW Timed.vi
Of course, if everything is currently working as you need it you may not have to change anything--I just wanted to offer another possible alternative and try to shed some light on what is going on. Thanks for posting!
-John