06-17-2024 01:24 AM
Hi all guys,
I need to syncronyze the time of Crio with the time of a PC connected in the same local network.
I follow this paper: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YIF2CAO&l=it-IT
The NTP server and client are running well.
I just have one question: how do I force the time update on the crio? I searched for ntpq commands but no solution. Do you have any advice?
(No TSN-enabled targets on the system).
Thanks!
06-17-2024 03:11 PM
Hi danieletime,
as far as I know, there is no command to synchronize the time in one step. When the NTP daemon runs, it synchronizes the system time slowly in very little steps. But when you shut down the system (or restart it), it should set the system time directly to the actual time.
You can check the offset to a time-server with the command `ntpq -p`.
06-18-2024 07:50 AM
Thanks for the reply Manuel,
What do you mean by "actual time"? When I restart the crio nothing happens, it seems to never synchronize the time with the NTP server.
In the attachment: the "ntpq -pn" reply and "/etc/ntp.conf" file.
06-20-2024 07:32 AM - edited 06-20-2024 07:33 AM
It looks from the ntpq response that the network connection to your NTP server has been interrupted at some point (AFAIK .XFAC. means interface association change).
Have you tried restarting ntpd after all the network interfaces have been fully configured, DHCP completed etc?
/etc/init.d/ntpd restart
Also have you checked that you can access your NTP server (e.g. via ping if it is configured to respond to ping). It seems like you are using an NTP server on a local LAN - what is it synchronised to? Note if it is not trusted (stratum is too high) you may struggle to get it to sync. Also you may find the first time it takes a long time to sync (although once it has synced once it is usually much faster subsequently).
06-20-2024 08:47 AM
Thanks AaronL,
I don't know why, but doesn't work. I tried the ntpdate instead ntpq, and the syncronization working well when I lanch the "ntpdate 192.168.10.3" command. But within a few seconds the offset continues to grow, until it reaches 2.796 seconds. See screenshot. Why? This really disturbs me!
09-19-2024 04:09 AM
Hi,
The first thing I'd like to say is that it's a shame that the time can't be set effectively on the Linux RT target, and that the only way to do this is to use NI MAX or the "Set time" function from the System Configuration, which is slow, memory-consuming and easily produces errors of up to 3 seconds. In the video from 2019 (https://www.ni.com/en/shop/compactrio/compactrio-timing-and-synchronization.html) I learned that "some functions are not ready for Linux RT targets, but this will be fixed very soon". Today is the fall of 2024.
Time synchronisation is generally poorly documented and pretty much does not work, even if everything is done according to the manuals. There are actually a number of manuals on the same subject (how to set up time synchronisation on the Linux RT cRIOs), but none of them are complete, they are missing important information, they contradict each other in some places (especially suggested configs), or they are just plain wrong. I've spent a lot of time on this this week and still can't get it to work. Maybe it is just me.
Anyway, my findings are below (cRIO 9053 and a struggle to synchronise the time with the PC).
Disposition:
What I tried/found:
After all, the promised sync quality of 1 ms or even 1 us at the moment looks like a bad "up to" advertisment (https://www.ni.com/en/shop/compactrio/choosing-a-compactrio-synchronization-technology.html), because right now I see a nearly 2 seconds offset.
I would really appreciate if someone can provide the working step-by-step instruction for the TSN-enabled Linux RT target, connected via [USB-]network to the Windows PC.
P.S. Sorry for rant.