KRL System Time Milliseconds

  • Hello to everyone,

    I would like to know if it is possible to get the system clock in milliseconds on the KR C4 controller.

    What I am looking for is something similar to $DATE (attached snip from the Kuka System Variables document).

    In C++ I would get this value by the following program:

    #include <iostream>

    #include <windows.h>

    int main()


    std::cout << GetTickCount();


    In Arduino I would get this value by the following function: millis()



  • AD
    • Helpful

    Yes, for some reason, the CSEC member of the $DATE aggregate never updates. I suspect that, when the $DATE variable was created, CSEC was added for potential future utilization that never came about.

    $TIMER variables act like stopwatches, and have a 12ms resolution. Can be set to any value between -2147483648 and +2147483647, and can be stopped/started on command. Also has the $TIMER_FLAG variable associated.

    $ROB_TIMER is only available in KSS 8.x, and has a resolution of 1ms. However, it cannot be stopped or started -- it begins at 0 any time the robot is booted, and counts continuously upward until it hits the upper 32-bit bound and rolls over back to 0.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now