LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elapsed Time in a sub vi

Subvi Timer.jpg

I have a program that usesa bunch of sub-VIs and one of them uses an elapsed time function (inside the sub vi), and I would like for it to continually update the timer on the front panel.  I have tried a couple things but I cannot seem to get it to work.  In the examples above I tried to get it to wait 20 seconds.  In the first one (without any while loop or other structure) the program ends immediately and doesn't wait any time at all.  In the second one it waits but only spits out a value at the end, and its a funky number.  I can make it work without using the sub vi no problem, but as soon as I try to do it with a sub vi it doesn't work.

0 Kudos
Message 1 of 2
(2,766 Views)

Your wacky number is the number of seconds since Jan. 1, 1904 or something like that.  If you convert it to a timestamp, you'll see it is the current time.

 

If you want to create a subVI, but have it update an indicator in another VI, then have the other VI pass in a reference to the indicator and use a Value property node on that reference to update it.  If you want the time that has passed since the subVI started, then use the Elaspsed Time output.

Message 2 of 2
(2,762 Views)