cancel
Showing results for 
Search instead for 
Did you mean: 

Help with a function to count program's elasped time

BurningH34t
Member

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.

Tags (2)
8 REPLIES 8
GerdW
Knight of NI

Re: Help with a function to count program's elasped time

Message contains an image

Hi Burning,

 

that's the official way:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Knight of NI

Re: Help with a function to count program's elasped time

Message contains a hyperlink

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...

BurningH34t
Member

Re: Help with a function to count program's elasped time

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.

GerdW
Knight of NI

Re: Help with a function to count program's elasped time

Message contains an image

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
JÞB
Knight of NI

Re: Help with a function to count program's elasped time

Message contains a hyperlink Message contains an attachment

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
BurningH34t
Member

Re: Help with a function to count program's elasped time

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.

Highlighted
GerdW
Knight of NI

Re: Help with a function to count program's elasped time

Hi burning,

 

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

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
JÞB
Knight of NI

Re: Help with a function to count program's elasped time

Message contains an image Message contains an attachment

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