09-20-2024 02:59 AM
I have a problem with the NI-9053 which is not able to synchronise with the NTP server. I have already posted some details in the comments to this post, but now I have done some measurements and it looks even weirder and worse.
Configuration:
What I did:
Combinations of the parameters I have tested:
Outcome:
Or like (~1.5 hours):
Summary:
Time synchronisation is poorly documented, it is impossible to set it up even if you do everything according to the manual, there are a number of manuals on the same subject, but none of them is complete, they are missing important information, they contradict each other in some places (especially the suggested configs), or they are just plain wrong (e.g. the config in the first "official" manual does not even connect to the NTP server without adding tinker panic and loopback settings; Windows time is at least somehow functional, unlike Meinberg NTP, etc.). I've spent a lot of time on this this week and still can't get it to work. Maybe it is just me.
So any ideas or tips are welcome! Maybe I have done something stupidly wrong and just cannot see it?
09-23-2024 12:52 AM
I took some measurements over the weekend. The time difference between the local Windows PC and the Compact RIO looks even more strange now.
One point in 20 seconds, so these regular "jumps" happen every ~9.5 hours. Maybe those are poinbts when the PC do synchronisation of its own clocks with the time.windows.com, maybe something else.
09-24-2024 01:57 AM
I managed to get the recommended Meinberg NTP to work. The NI manual, which recommends starting with an empty config, is wrong here.
And it does not synchronize CmpactRIO anyway, at least in IEEE-1588 mode (see below for overnight timings).
09-26-2024 09:15 AM
Thanks for posting this ... I am sure it will help somebody else scratching their head about how to do this (I remember one of my ex-colleagues mentioning something similar, but I can't remember what workaround was devised).
09-26-2024 09:22 AM
It would be great if you had a chance to ask...
Quick update, I have repeated the test with the 802.1AS and Meinberg NTP, the results are the same (i.e. synchronization does not work).
09-27-2024 01:27 AM
Another update. Yesterday I decided that if it doesn't work the way the NI manuals say, then let's do the opposite.
I removed NI-Sync altogether (fortunately I do not need it) and re-enabled native Linux synchronisation (as described here). Rebooted the system. Got below 2 ms time deviation within a minute or two. Did a very quick and dirty test routine (no logging etc, just a plot). The results of the ~14 hour test are below.
So there are some jumps (my guess is that this is due to the PC's own time synchronisation with the internet), but the result is at least stable most of the time and it just works. Of course, this is nowhere near what is promised with NI-Sync (and I have no idea what the people who need it would do), but at least it is a decent result.
09-27-2024 02:50 AM
Another update: It turns out that, for some reason, some of the DAQmx tasks (within the same CompactRIO unit) refuse to synchronise without NI-Sync installed (Error -209836). After reinstalling NI-Sync, all synchronisation stops working again. So it looks like it is possible to get everything working if I can somehow prevent NI-Sync from touching the system clock.
11-12-2024 09:33 AM
And sort of a final update (?)
I spent about 3 or 4 weeks with NI support trying to get accurate synchronisation with the PC or network (via NTP). It turns out that not only does NI-Sync not work properly* with the Linux cRIOs, it also prevents the normal Linux NTP features from working.
Cherry on the top is that due to a bug #2866609, you can't use the DAQmx without NI-Sync installed on the cRIO, so, at least until this bug is resolved, you can't really synchronize time on the cRIO automatically. With Ni-Sync disabled, I achieved the sync accuracy under 2 milliseconds with the local network NTP server. But since I need DAQmx, I have no other choice than "happily" live with the up to 8 seconds** time offsets.
Notes:
* Unless you have a real TSN hardware in your network, your switches and routers will support TSN and so on and so forth. This is not the case and is expensive. Other Linux-based cRIOs can't do that job, because to switch on TSN they need NI-Sync, and with NI-Sync enabled you can't sync them with anything else, except other TSN devices.
** That's what I measured on my system. The interesting thing is that the time reported by a "niSync Get Time" that I used in my code and other means of time measurement could be quite large and change over time. So, to be honest, I do not know how to reliably set and measure time on the Linux-based cRIOs.