In AllenBradley, there was GSV (get system value) of WallClockTime, with attribute CurrentValue. It was a millisecond, 64 bit timestamp of the current dateTime.
I found such a thing very useful for referencing globally and building extremely resource efficient timing code for various things.
In PLCNext, I’ve found that I’m only able to get time down to the second and not as a Unix epoch time (like, since 1/1/1970 or since 1/1/2000, etc.)
If this isn 't possible,
I’d also be very interested in finding any globally accessible millisecond incrementing integer. In microcontroller environments, this is called with a millis() function. It’s quite common and just counts the milliseconds since the controller entered run-mode.
I ended up making my own millis with a program set to interval 1 millisecond, containing only the code
millis := millis + 1;
with millis being a global double 32 bit int. I 'm concerned about the reliability of that method
I obviously set the millis program to have the lowest priority value so it will always interrupt any other program, but I can’t guarantee some system-level stuff won’t mess with my millisecond timing.