Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

IEC Timer vs Linux Timer

wilky93
2022-02-16
2022-02-16
  • wilky93 - 2022-02-16

    Hello all,

    I'm using the Control Runtime for Linux x86. On my System (C/C++ Apps) I use the monotonic timer for time measurements ( clock_gettime(CLOCK_MONOTONIC, &timestamp).

    In my CODESYS Project I want also have access to the monotonic timer of my system. So is it possible to use the same timer in codesys and in my c/c++ system application? I would like to have a common time base and match the test results.

    Thanks in advance

     
  • i-campbell

    i-campbell - 2022-02-16

    This should be SysTimeGetUs()
    I think some systems have a different CLOCK_MONOTONIC per core, so perhaps you will need to have the time calls on the same core. Perhaps not.

     
  • wilky93 - 2022-02-16

    Thanks. I will check this. I need nano seconds, then I think it will be SysTimeGetNs()

     

Log in to post a comment.