LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

elapsed time - seconds to string

Hello everyone,
I have what seems to be a simple problem that I can't resolve. In the attached example I wish to convert the elapsed time (s) to a timestamp (h:m:s.ms). The problem is that I can't get the timestamp to start a 00:00:00.000 , it starts at 11:00:00.000. What can I do to get the timestamp to start at an absoulte 0s and not have the hour reset after 24hrs. One of my applications runs for 180hrs.

thanks,
David
0 Kudos
Message 1 of 11
(8,090 Views)
I was going to open your vi and have a look at where you were, but, darn,I only have 7.0. So, all I can do is try to explain what I do for an elapsed time function.
I set a global variable to the current time ( in absolute seconds), go ahead an run whatever I am timing, and when I want an elapsed time value, I take the current time, again in absolute seconds, and subrtact the value stored in the global variable. Then you can use the "seconds to time" or whatever manipulation function your wish to give the elapsed time in something other than seconds.
Hope this is understandable, and not too muddled.

Good luck,

Dave
Message 2 of 11
(8,087 Views)
Hello Dave,
I saved the example to version 7.0.
0 Kudos
Message 3 of 11
(8,085 Views)
OKay, I see that you are getting seconds in approx. the same way that I do, all you need to do is take the number of elapsed seconds, and parse it into hours/min/seconds with some simple math. The Date/Time function will not give elapsed time, but rather it gives an absolute date relative to 1903 or something like that in the far distant past.

Have fun!

Dave
0 Kudos
Message 4 of 11
(8,082 Views)
Im having no luck.:( Any other suggestions or examples. Im sure I missing something very simple.
Thanks again.
0 Kudos
Message 5 of 11
(8,075 Views)
I hope I got what you need corectly,

please find it attached.
0 Kudos
Message 6 of 11
(8,071 Views)
Right click on your elapsed time control and select format and precision.
Select relative time.
That's it.
That will be 50$, please.

___________________
Try to take over the world!
0 Kudos
Message 7 of 11
(8,067 Views)
I hope I understood you correctly.
You want to have the net time of your program displayed in HH:MM:SS format but your problem is that the string starts at 11:00 am and that after 23:59 it goes to 00:00. In that case, my suggestion should help. The number will be displayed correctly.
And now, a magic trick...
You live in.......... Australia!
Or somewhere near that time zone. The reason you're seeing 11:00 when you input 0 into the format function is that the internal LV timer starts from 00:00 GMT 01/01/1904. The 11:00 you're seeing is actually in 1904, and that's also the reason the time is reset after 23:59.
You can also use the Get date/time in seconds VI Instead of the ms counter. You won't need to divide by a 1000.

___________________
Try to take over the world!
0 Kudos
Message 8 of 11
(8,062 Views)
If you use the time formatting of LabVIEW, it is always going to roll over at the 24 hour mark. The solution is to roll your own formatting. Attached is an example which should do what you want (LabVIEW 7.1).
Message 9 of 11
(8,050 Views)
Thanks everyone.
DF Gray - Perfect!
0 Kudos
Message 10 of 11
(8,031 Views)