Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I stop an two edge separation with infinite timeout?

Solved!
Go to solution

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.

0 Kudos
Message 1 of 4
(3,393 Views)

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.

 

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 4
(3,369 Views)
Solution

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.

Randall Pursley
Download All
0 Kudos
Message 3 of 4
(3,363 Views)

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.

Mensaje editado por kiftren
0 Kudos
Message 4 of 4
(3,333 Views)