Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Err -200088 When I using DAQ for analogue output

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

Error(-200088).png

0 Kudos
Message 1 of 8
(4,426 Views)

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.

0 Kudos
Message 2 of 8
(4,421 Views)

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.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 3 of 8
(4,419 Views)

Dear bstrieff and :

 

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!

 

Error(-200288).png

0 Kudos
Message 4 of 8
(4,413 Views)

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.)

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 5 of 8
(4,398 Views)

Here's why you're getting the error: From the driver's perspective, you're doing the following:

  • DAQmx Create Channel (AO Voltage).vi
  • DAQmx Timing (Use Waveform).vi, to Finite Samples with the number of samples in your waveform (which appears to be the default for the Basic Function Generator VI, which is 1000 samples)
  • DAQmx Write (Analog 1D Wfm NChan NSamp).vi
  • DAQmx Start Task.vi
  • Poll once (?) on DAQmx Is Task Done.vi (based on your loop-counter > 1 check). You also don't actually check the task done? terminal, so this loop's completion will never actually correspond with the task being done. (considering that your waveforms have a sample rate of 1000 samples per second, and you have 1000 samples, your analog output will take 1 second to complete... the only way that this 'works' is because you're using Execution Highlighting, which slows execution.)
  • DAQmx Timing (Use Waveform).vi, but you're not actually changing any of the timing settings from what they were before.
  • DAQmx Write (Analog 1D Wfm NChan NSamp).vi, which is where you get the error; from the hardware's perspective, it has already written all of the samples you told it to write (remember, you said you wanted Finite Samples), so it gives you an error telling you that you've attempted to write, but that the hardware has finished writing. You actually need to stop the task (with DAQmx Stop Task.vi) before you can write again.

 

So you need to fix:

  • The use of DAQmx Is Task Done to properly exit your polling loop.
  • Using DAQmx Stop Task after all samples are written, so that you can set up a new waveform and start your task again.
——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 6 of 8
(4,395 Views)

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.)

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
Download All
0 Kudos
Message 7 of 8
(4,393 Views)

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:

sawtooth wave.png

0 Kudos
Message 8 of 8
(4,386 Views)