LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with a function to count program's elasped time

I want to add a little function to my program where it counts how long it takes for the program to finish. Essentially, you hit run, then the clock starts counting until the end of the program with an indicator so the user can see how long its been/takes to finish.

 

Thank you.

0 Kudos
Message 1 of 9
(3,724 Views)

Hi Burning,

 

that's the official way:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,720 Views)

You could also use the Elapsed Time Express VI.

 

You should also consider voting for this idea: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-a-quick-quot-Timing-Probe-quot-for-Timing-Metric...

Message 3 of 9
(3,713 Views)

thank you for the replies, they definitely help.

I was also wondering is it possible to have an indicator that counts 1 second at a time as the program is running (basically like a digital clock)? The solutions provided will tell me the amount of time it takes from start to finish which still helps alot. I just thought it'll be cool for the user to see a clock timer (h:mm:ss) counting up while the program is being run.

 

I tried messing around with the Elapsed Time Express VI but it's not really working, and also, is it possible to use this to do the clock counting idea mentioned above?

 

thanks.

0 Kudos
Message 4 of 9
(3,708 Views)

Hi burning,

 

there are timestamp indicators:

check.png

Call this piece of code once a second...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 9
(3,703 Views)

In this community nugget I presented a re-usable timer component that may meet your needs.  I've extracted and attached the Resource Module its enum control type def and a sub-vi that handles the display format.  Feel free to look into the nugget for an example of how the module was used.


"Should be" isn't "Is" -Jay
Message 6 of 9
(3,701 Views)

Crap, I forgot to mention that I want to start the count at 0:00:00 then count up from here. Using the time stamp idea does work and counts up but I would prefer starting at 0 then count up without the date or current time. So if  the program takes 1 hour and 15 minutes(10 seconds) from start to finish for example, it'll display 1:15:10 on the front panel.

 

Again, thank you for the help.

0 Kudos
Message 7 of 9
(3,694 Views)

Hi burning,

 

use a standard numeric indicator and change it's formatting to display time as "HH:MM:SS" (in it's properties)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(3,690 Views)

her's the example.

 

NOTE: somehow these cases got swapped in the timer vi i attached earlier. The picture below has correct case for update

 

1.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 9
(3,686 Views)