LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 200088 using the DAQmx Read VI in a case structure

Solved!
Go to solution

Primary problem: I am trying to write a VI which will read data from a DAQ and write it to a text file when I hit a 'Record' button. To do this, I am using the DAQmx Read VI within a while loop, which is within a case statement (I hit the 'Record' button to set the case to true), which is within another while loop. My DAQmx Create Virtual Channels VIs are outside of the loops, so a wire runs through all three structures to connect these VIs to the DAQmx Read VI.

After I hit 'Record,' my VI works until I hit the 'Stop' button, at which point I receive Error 200088: "Task specified is invalid or does not exist." If anyone can help me get rid of this error, that would be greatly appreciated!

I have attached my VI and an image of the error.

Secondary problem: Currently, I am using two different DAQmx Read VIs: the one mentioned above, which enacts after I hit 'Record,' and a second which reads data continuously to display on charts. I would like to combine these two, but do not know if that is possible given the case statement.

 

Thanks!

Download All
0 Kudos
Message 1 of 5
(3,451 Views)

Hi alexwright,

 

It seems like you are getting that error because you are trying to clear the same task twice.

 

Moving forward, I would recommend implementing your case structure within the top while loop with the use of the output of the first Analog 1D waveform. This way you will only need to clear one task and hence avoid the error.

MJ
Application Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,413 Views)

Thanks for the response, M.J. When I move the case structure to the top while loop, and hit the record button, the waveform charts freeze, and the case loop does not execute properly. Also, won't this move slow down the overall while loop too much (that may be linked to the new problems, I don't know)?

0 Kudos
Message 3 of 5
(3,403 Views)
Solution
Accepted by topic author alexwright

Hi Alexwright,

 

I made some quick modifications to demonstrate the producer consumer loop that would be effective in your case. You want to producer loop in the first while loop so that you are using and closing the same DAQmx task. Moving forwardthis will require some testing and modification to be effective for your application. Please also make sure to use our debugging tools: http://www.ni.com/gettingstarted/labviewbasics/debug.htm.

 

Hope this helps.

MJ
Application Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,378 Views)

Thanks! I think I got it to work now!

0 Kudos
Message 5 of 5
(3,353 Views)