I have CODESYS Development SW version "3.5 SP15 patch 1" running on Windows PC and "CODESYS Control for Linux SL" Soft PLC version 3.5.15.10 running on Ubuntu 16.04.6 LTS in demo mode. For my learning task I need to get the current RTC time with nanosecond resolution, similar to what I would get with the following c-code in 'timestamp_now':
struct timespec time_now;
clock_gettime(CLOCK_REALTIME, &time_now);
const uint64_t timestamp_now = UINT64_C(1e9) * time_now.tv_sec + time_now.tv_nsec;
Checked the standard libraries included in CODESYS, cannot find what is required, found only: 1) SysTimeRtcHighResGet: current RTC time with milli-second resolution, the resolution is not enough for my task; 2) SysTimeGetNs: Looks like uptime with nano-second resolution; I cannot use this value for my task;
Any idea if any free (probably, in a demo mode) library can be used for getting the current RTC with nanosecond resolution in my Soft PLC?