LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Usage of "Elapsed Time" Express VI

I'm trying to program in Labview something like "Action 1" -> Wait 5 seconds -> "Action 2" -> Wait 5 seconds -> "Action 3". The "wait 5 seconds" should not block everything else but other tasks / VIs should continue running. Does anybody have a good solution for this? I tried to use the Elapsed Time Express VI but it does funny things. Can anybody explain to me how to properly use the Elapsed Time Express VI and especially how the reset input works?
0 Kudos
Message 1 of 3
(3,027 Views)
I have not used the Elapsed Time Express VI, but I think you just need a simple Wait(ms) function. A state machine will do nicely what you want. Search the archives for lots of information.

Basically, it consists of a while loop containing a case statement. Each "Action x" is in a separate case. The Wait is in another case. A shift register passes the "Next case" parameter.

Lynn
0 Kudos
Message 2 of 3
(3,027 Views)
As Lynn said, I think all you need is a simple Wait(ms) call, but to answer your specific questions...

The Elapsed Time Express VI tells you if the time you specified for Elapsed Time has expired; it does not actually wait for the time to expire. An example of how you would use this is to include a call to the function in a loop. When the "Time has Elapsed" boolean is true, you perform some action. If not true, you do nothing. This would allow you to use a fast running loop that only did some elapsed time action every so often instead of every time through the loop.

The Reset you asked about is a way to reset the internal state of the VI. The VI keeps state information, which makes sense and is normally what you want it to do. However, you may want to have it
reset on this particular execution, e.g. on the first iteration of a loop that is within an outer loop.

Hope this helps,
Roy
0 Kudos
Message 3 of 3
(3,027 Views)