LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does the milisecond timer work?

Solved!
Go to solution

Hi, Hope you can help, I am just trying to understand how the milisecond timer works. If you set a timer alone or wire an indicator to it, the output is a number like 1.179578E+8.   Only if you subtract one from the other do you get a meaningful number.

Where does 1.179578E+8  come from?

Is there a way to get fractions of a milisecond?

 

0 Kudos
Message 1 of 5
(206 Views)
Solution
Accepted by topic author EdHarris

It is a relative millisecond counter and the absolute value has little meaning. To get better time resolution, use "high resolution relative seconds" instead.

 


@EdHarris wrote:

Where does 1.179578E+8  come from?


It might be related to the elapsed milliseconds since you started the computer, but it will wrap around once U32 is exhausted.

 

(I cannot open your VI. Consider "save for previous" (2020 or below), before attaching. For example there is nothing called "millisecond timer" so I assume that you are talking about the tick count (= same as the output of various waits) instead.)

Message 2 of 5
(200 Views)
Solution
Accepted by topic author EdHarris

The number itself is the number of milliseconds since the PC in question was powered on... OR it's how long it's been powered on plus a multiple of the overflow (2^32 ms = approx 49.7 days).

 

For example, the number you give in your post means that your computer was probably powered on 1 day and about 8 hours and 45 minutes before you obtained that number.

 

That said, I still agree with Altenbach.  Use "high resolution relative seconds" instead.

Message 3 of 5
(191 Views)

Hi again Altenbach, I have posted an earlier version update in case anyone wants to see. Your solution is a considerable improvement but I did not try it before because the description in detailed help implied that the high res timer only output in seconds not milliseconds. And Kyle your prediction about when my PC restarted is very good. Thanks.

0 Kudos
Message 4 of 5
(157 Views)

@EdHarris wrote:

Your solution is a considerable improvement but I did not try it before because the description in detailed help implied that the high res timer only output in seconds not milliseconds.


The time is a DBL and there is no reason to convert to DBL again. You can easily do micro and nanoseconds by using a SI format.

If you want it in fractional milliseconds, just multiply seconds by 1000, right?

 

altenbach_0-1738884263017.png

 

Message 5 of 5
(131 Views)