> According to the Online Help, LabView's millisecond timer rolls over every
> 2^32 ms (about 5 days). I need to use the timer repeatedly in a VI which
> will run continuously over many days (for timeout errors). The times it
> will be marking are only on the order of 5 seconds or so, but I don't want
> a timer rollover to throw an error in the program. Is there a way to avoid
> this, short of detecting when the timer is near its limit and putting in
> an artificial wait while it rolls over?
>
> To clarify, it's OK if the timer rolls over, but it cannot roll over in the
> 5 or so seconds during which I'm timing something. I have to time these
> (approx.) 5 second intervals very very often, so it's very likely that a
> rollover will happen eventually, and I want t
o avoid problems with it.
>
Actually, according the math I just performed, the rollover is about
every 45 days, not 5 days. Also, if you are subtracting two times,
which are unsigned numbers, then the delta will always work out
to be what you wanted, even when a rollover happens. A
small unsigned number after rollover minus a large unsigned
number before rollover, yields a small positive number.
Feel free to try it with something like a U8 to see for yourself.
So the rollover is a problem with any absolute times that you
might want to record, but doesn't affect deltas unless they
span more than one rollover -- in which case you can't tell the
difference between having zero, one, two, or any other number of
rollovers. As long as your time interval is less than 45 days
and the resolution of 1ms is small enough, then the built-in timer
should work well.
Greg McKaskle