LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time origin of "Global Start Time" in Output Node of Time Loop

Hi All,

 

Please, do you know how the time returned by Global Time Start (after converting in milliseconds) in the Output Node of a Timed Loop is related to the time returned by “Tick Count (ms)” (if the latter is read at the very start of the loop)?

 

The look similar but they are not the same.

 

Is it right that the time returned by Time in the Node of an Event Structure is the value of “Tick Count (ms)” when the event takes place?
 
Have an awesome day,
 
LucaQ
0 Kudos
Message 1 of 2
(2,623 Views)
Hi LucaQ,

This is a really interesting question. To answer the easy part, the Tick Count and the Time event data node for an event structure both output the same thing, the ms clock value obtained from the OS.

The Global Start Time node outputs a nanosecond-resolution clock value. I'm a little fuzzy on details, but my neighbors and I believe that this clock comes directly from the processor (or more directly at least). If you look at the differences between this nanosecond clock and the ms clock for the OS, you'll see that the OS ms clock "lags behind." For example, look at these values output by the 2 clocks:

Global Start Time:
335654376684899

ms timer value:
335650557

If you scale the nanosecond value up to ms, you see that 335654376.7 is greater than 335650557.

I believe this time offset can be accounted for if we assume that the OS (such as Windows) takes this nanosecond clock and derives a ms clock from it. In addition, it will take some time for that ms value to propagate through the various levels of software up to your end-user application level. The nanosecond clock comes directly from the processor, and the Timed Loop uses lower-level functions to obtain it. Because it has fewer layers of processing to pass through, it is a higher (more recent) number.

In light of all this, I would use the Global Start Time only for comparing against other Timed Loop nanosecond clock values like Global End Time. Do not expect to scale it and subtract a ms clock value to get the time elapsed or anything like that.
Jarrod S.
National Instruments
0 Kudos
Message 2 of 2
(2,618 Views)