10-21-2008 02:35 PM
Hi!
I use the example VI: "Meas Two Edge Separation.vi" (see the archive of this message) with a NI USB-6251and a infinite timeout because I don´t know when I need to start a new measure. With this characteristics I need stop the DAQmx VI "DAQmx Read.vi" if this VI don´t stop in a predeterminate time (10 sec.) but I dont know how must I do.
I can´t use a watchdog because the NI USB-6251 haven´t a watchdog. I try reset the daq with "DAQmx Reset Device.vi", but when I make it, the daq break. I too try to use "DAQmx Control Task.vi", "DAQmx Is Task Done", and "DAQmx Trigger.vi" with reference-none, but this vis never execute until "DAQmx Read.vi" ends.
Thanks.
Solved! Go to Solution.
10-22-2008 09:33 AM
A simple approach is to let the Read have a shorter timeout, and then put a loop around it to keep trying until it does *NOT* time-out. After each timeout, you are free to stop the task if needed, based on whatever criteria you have in mind.
-Kevin P.
10-22-2008 10:21 AM
Try the attached. It is saved as 8.0 since I am not sure which version of LabVIEW you are using.
The card I have in my machine cannot perform the task you want, so I didn't get a chance to test it.
10-26-2008 06:12 AM - edited 10-26-2008 06:15 AM
Thank you Kevin and thank you Pursley, yours solutions are very interesting.
Finally, I use the solution of Pursley, because this is the solution I need, but I have another problem with this method. In my program, your source code is a subVI and you never see his front panel. My stop button is a global variable, and, because this I can't use the code included in your picture "Two-Edge 2.PNG". Can I use this code with a global variable like stop button? I try put the value of this global variable in another indicator and use the event: "value change" of this indicator like your code source of your picture "Two-Edge 2.PNG", but it doesn't function correctly. The program only functions when the user uses the user interface to change it value.
Thank you.