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!