05-30-2012 01:30 PM
Dear all,
When I using DAQ to analogue output an signal in Labview 2011, this function is located inside a while-loop. For the first round, the
DAQmx Timing.vi can work, but for the 2nd time, it throw out an error with code -200088. Can anyone help me about this problem? Thank you.
See the following graph, and also enclosed the *.vi file
05-30-2012 01:44 PM
Since you are clearing the task inside the loop, the error message makes sense, doesn't it? Move it outside.
Your VI is very difficult to read. Clean up the wiring and try to get it to fit on a single screen.
05-30-2012 01:45 PM
Error -200088 is Task specified is invalid or does not exist.
You're doing a DAQmx Create Channel (AO Voltage), which creates a task, outside of your loop, then doing DAQmx Clear Task inside of the loop. On the next iteration, the task you created no longer exists, which is why you're getting that error.
You can either move the DAQmx Create Channel inside the loop (which means that you're creating the task anew every iteration, which incurs some overhead) or you can move the DAQmx Clear Task outside of the loop.
05-30-2012 03:17 PM
Dear bstrieff and Dennis_Knutson:
Thank you for your timely reply. I modify the Vi file according to the suggestion in your posts. But this time the error (code: -200288) occured at another VI, see the following picture, and enclose please find the modified VI file.
I adjust the positon of wire to make the whole VI be easier to read,
Thasn you!
05-31-2012 01:38 PM
That's a different error (-200288, not -200088). The text for that is:
Attempted to write a sample beyond the final sample generated. The generation has stopped, therefore the sample specified by the combination of position and offset will never be available. Specify a position and offset which selects a sample up to, but not beyond, the final sample generated. The final sample generated can be determined by querying the total samples generated after a generation has stopped.
(You can use Help->Explain Error... in LabVIEW to get information about error codes, or you can create an error-out probe or indicator on the wire.)
05-31-2012 01:39 PM
Here's why you're getting the error: From the driver's perspective, you're doing the following:
So you need to fix:
05-31-2012 01:42 PM
After fixing those, your end result should look something like the following screenshot. (I took all the NI-Scope stuff out so as to focus on the DAQmx-related stuff-- obviously you'll need the NI-Scope calls for your application-- and did some general cleanup so I could fit it all into the same screenshot)
(Sorry for so many posts-- the NI forum software keeps complaining that my posts are too long! Apparently it's because I kept trying to insert this screenshot inline. D'oh.)
05-31-2012 03:03 PM
Hi, bstreiff
Thank you for your good explain.
I try the Vi you posted. It can work smoothly. However, the speed is relatively slow compared to my application. My application is like this:
The NI-digitizer is triggered by the rising edge of a square wave, and the software count the number of triggering (using variable i in the whole loop), and using this nuber to produce a sawtooth wave. the frequency of this sawtooth wave is about 25HZ, do you think is it possible realize by software, or a hadware counter has to be used?
Thank you again.
sawtooth wave: