02-22-2008 05:00 PM
02-23-2008 09:42 PM - edited 02-23-2008 09:45 PM
02-23-2008 09:57 PM
02-25-2008 01:25 PM
Hi DanJS,
It’s always a good idea to first start with something proven, get it to work, and then add more functionality.
As mentioned, LabVIEW ships with examples, found by choosing Help » Find Examples. You have to navigate the Example Finder, and the example “Cont Gen Voltage Wfm-Int Clk-On-Board Regeneration.vi” is a good one to start with. It is found under Hardware Input and Output » DAQmx » Analog Generation » Voltage.
11-14-2012 07:54 AM
Hi all,
I'd like to get back to this thread because I have the exact same problem and I can't find any nice solution.
I use an analog output to generate a voltage. I use a continuous generation. I'd like that the voltage is send back to 0 at the end of the execution of the VI whereas it always retain the last value generated when I stop the generation.
Here is what I tried:
1. writting a 0 just before clearing the task.
2. writting as many 0s as necessary to fill the buffer and then clearing the task (VI attached).
3. resetting device at the end. This works but it's a little bit like repairing a watch with a hammer.
Any clue why solution 2 doesn't work ?
Thanks a lot !
11-14-2012 08:10 AM
You might have to stop the task, write the buffer, and restart it. Then stop and clear the task for good.
11-14-2012 09:05 AM
Hi and thanks for the quick answer.
I tried what you propose, stopping the task, writing 0s in the buffer, starting the task again, stopping, clearing. No change, I still have a non-zero voltage at the end. I also try to 50ms after the start, to be sure the task writes in the buffer, no change.
Any other idea ?
11-14-2012 10:49 AM
I had a similar problem to this a while ago. I think it was because I was clearing the task before the D/A had chance to write the zeros.
I thought this would have been accounted for in your DAQmx Wait Until Done (VI). Reading the Help, it says it is normally used for finite generation and not continuous so maybe this is the problem?
I would try putting a nice big wait before clearing the task and remove the Wait Until Done VI.
Kind Regards
11-15-2012 04:44 AM
Here is what I do:
Running this with animated execution tells me that the "Sart Task" VI hangs a little and produce error 200946.
Looking at the forums for this error, I found this thread.
So, it seems there is no simple solution to send the AO to 0 after the execution of a VI. In my opinion, the default behavior should be to send all the outputs to 0 when the tasks end, but it's only my opinion...
11-15-2012 12:07 PM
Ok, I solved my problem by writing zeros on my output starting a new generation.
It's not really satisfying, but it works.
Thanks for the help !