How to Confirm NTP Connection With My Real-Time Target

Updated Jan 26, 2023

Environment

Hardware

  • CompactRIO Controller

Driver

  • NI CompactRIO

Operating System

  • NI Linux Real-Time

I set Network Time Protocol(NTP) on my CompactRIO controller with Linux Real-Time OS to synchronize system time following this link, Synchronize Linux Real Time Targets with Network Time Protocol (NTP) Server .


It seems to work that the system time of cRIO chases the time of host server.
Is there a way to monitor NTP connection status? How can I confirm that the NTP network is connected well?

You can check NTP connection by typing the following command line on PuTTY:

ntpq -p or ntpq -pn

Please refer to this link how to use PuTTY. Accessing the Shell on NI Linux Real-Time Devices


It shows the billboard of NTP servers connected with the target. You can see the list of NTP server's name or IP address that you configured in ntp.conf file in the target.
The symbol in front of the server name indicates the status.

The following table shows the description of indicators:  

 Indicator 

Status

Description

 reject“LOCAL clock” for this localhost or the peer is discarded as unreachable, synchronized to this server or outrageous synchronization distance.
x falsetick Out of tolerance, do not use (discarded by intersection algorithm)
outlyerOut of tolerance, do not use (discarded by the algorithm of cluster)
#selectedGood remote peer or server but not utilized (not among the first six peers sorted by synchronization distance, ready as a backup source)
+candidatGood and a preferred remote peer or server (included by the combine algorithm)
*sys.peerThe remote peer or server presently used as the primary reference


 

If there is "*" symbol in front of the server like below capture, your target is synchronized on that time server.
 




But when the server is not connected, there is a blank symbol and st(stratum) value is 16.


 

Note : After you restart cRIO or restart NTP daemon by commanding /etc/init.d/ntpd restart, it takes about 5 minutes to connect to NTP server. You will see the symbols change to "*", "+" etc and st values in a few minutes.
 

Additional Information

If the symbol is still blank and the value of st is still 16, then you can check below :
 

  • Ensure that your ntp.conf file in host time server is set up properly. You have to check whether the host server restricts client access or not. For example, the configuration file in the host server should include the following line to allow access of the client:

restrict <Client IP address> mask 255.255.255.0 nomodify notrap

Note: If you use Meinberg NTP Software in host PC, you can find this file at the location below:
 

 Start » Meinberg » Network time protocol » Edit NTP Configuration
 

Here is the link about Meinberg NTP daemon, How Do I Configure My Host Computer as an NTP Time Server?
After editing and saving ntp.conf file, you have to restart daemon to update that configuration.

  • NI-Sync installed at Real-Time target controller could disturb synchronization. Please ensure NI-Sync is not installed in a Real-Time target.
  • Try to synchronize with other NTP server, for example, public NTP server on the internet. There are several public servers service in your region.
  • TSN-enabled targets (such as cRIO-904x targets) are not currently compatible with any type of synchronization besides IEEE-1588 (PTP) and 802.1AS synchronization.