Maximum timer value

  • What is the maximum value of a timer?


    Example, I start a timer and let it run indefinitely. At some point it has to overflow. What's the limit, and what happens if it does overflow?


    My assumption is that it is a signed integer, so 2,147,483,647 mS. That's about 24 days. We certainly have robots that stay powered up longer than that, so what would happen if a timer was running the entire time?


    I guess I could fire up officelite and play, but I thought someone might have a quick answer.




    I hate KUKA's timers, and might right my own library to handle timers to run on a separate submit interpreter. The way I plan on doing this involves letting a single timer run basically indefinitely. At some point, I need to reset this timer to keep it from overflowing, I just need to A) know where that limit is and B) figure out how I'm going to handle a reset event, but that's on me.
    Thanks!

  • In case anyone in the future has this question:


    It is a signed integer, and the limit is 2,147,483,648 mS.


    When it overflows, the value loops back around to -2,147,483,649 and continues counting.


    That was a fun experiment. :uglyhammer2:

  • You beat me to it. This is what I get for taking the weekend off. :party1:


    But yes, you are correct. The $TIMERs are 32bit signed integer, and if allowed to run indefinitely will simply roll over and keep going... FOREVERRRRRRRR!!!!!!!

  • And the flag alternates at a frequency of 0.000000232830644 Hz!


    It least it doesn't overflow and crash! Although, if that's what it did, I'd expect that to come up A LOT on here.

Advertising from our partners