ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait (ms) Function and Cicles

Solved!
Go to solution

Hi, I want to give a wait to my VI (it could be 1 second same as 1h or more). I was using the wait function but what I want to know is if it is possible to set a break  so that the user can interrupt the VI before the wait function has finished.

In case it is not possible should I replace it with a for/while cicle? If yes, what is the duration of each iteration of a for/while cicle without any element in its inside?

Thank you guys

0 Kudos
Message 1 of 7
(3,336 Views)
Solution
Accepted by topic author inuyasha84

No, you cannot abort a Wait (ms). You can abort a Elapsed Time function.

 

It's sillyto ask how much time a loop takes with nothing in it. You can't have a loop wait for x amount of time without code inside the loop.

Message 2 of 7
(3,331 Views)

Yea I suppose that was silly a thing like that with the for/while cicle but I need to set a break.

About the Elapsed time function how can I stop it?

Thank you for your help

0 Kudos
Message 3 of 7
(3,326 Views)
It's inside a loop. Don't you know how to stop a loop? Read the help. The Time Has Elapsed output or a Boolean control will stop the loop.
Message 4 of 7
(3,320 Views)

mmm I saw the example and read the help. I think I should use the time delay instead since I want that the user set the time to wait.Is it correct?

 

EDIT: no you were right. I read better the help.

Thank you for the help now it is clear 🙂

0 Kudos
Message 5 of 7
(3,315 Views)
No, no, no.

You can set the time for the Elapsed Time function in the exact same manner as the Delay or Wait (ms). As I already said, you cannot abort the Wait (ms). If you didn't care about aborting a long wait, why did you ask the question in the first place?

This is trivial. Place an Elapsed Time function in a loop with a stop button. Run the VI. Whatch how you can stop the loop at any time. Create an indicator for the Time Has Elapsed output. Whatch it.
Message 6 of 7
(3,310 Views)

yep I edited the message. at the end I did the VI as you write in your last message 🙂

Thank you

0 Kudos
Message 7 of 7
(3,308 Views)