LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing cRIO 9030 to (S)NTP?

Solved!
Go to solution

Subject says it all - we do have 4 shiny new cRIO-9030s for a project, and need to synchronize them to NTP, but there is no option for this in MAX. I've installed NI-TimeSync 14.0, but it does not appear in the installable software list for this target?

Please, how can we sync these controllers to NTP? They are running Linux, so that should be no problem. Even the lowest cost embedded modules can do this!

I general, we do feel that time synchronisation of cRIOs to (S)NTP is mostly unsupported - why??

Thank you,

     Jörg

---
Jörg Heßdörfer
Certified LabVIEW Architect, S.E.A. Datentechnik GmbH
Message 1 of 7
(14,546 Views)

Hi Jörg,

SNTP is not a shipping feature on the cRIO controllers.  The team has been prioritizing SW-1588 on the Linux devices since that can provide a higher accuracy synch than SNTP.  However it will only work over a LAN and will not synch to SNTP time.  If you are trying to synch the controllers to each other and they are on the same subnet then SW-1588 may be a good option for you.  I can get you more details if needed as I think this is technically shipping in 14.1. 

If you need to synch to a NTP time server then there are three options:

  1. There is a Linux function for SNTP.  If you are comfortable with Linux you can run this daemon on the 9030s to get time synch.
  2. You can synchronize one machine (cRIO or other) on the network to SNTP and then have it serve as the 1588 master to synch the other devices. 
  3. You can synchronize the cRIO systems to NTP using explictic UDP calls and writting the current time in LabVIEW.  I've done this on some of the VxWorks targets (no daemon available) and can share the code if helpful.  I'll also caution that my code was good enough for my app but I often had time-outs on the UDP response from the time server.  It's OK if you are trying to keep roughly aligned but not ideal if you want good accuracy on a headless system. 

Let me know what direction you decide to pursue and if you need help. 

Message 2 of 7
(10,372 Views)

Joergh,

I have been using the UDP implementation of the synchronization to the NIST time server in this discussion forum successfully.

http://forums.ni.com/t5/LabVIEW/help-with-connecting-to-NIST-NTP-server-on-port-123/m-p/1196853/high...

I sync once an hour to account for drift in the system clock.  I would be interested to hear if you have luck with a more embedded solution.

Rob

Message 3 of 7
(10,371 Views)

Thanks,

yes, I am aware of options 1. and 3.

We already implemented option 3. a couple of yers ago, when NI-TimeSync was not available. With the  NI-SystemConfig the time delay for setting the new time is unacceptable. Even though we need only rough accuracy (for activity logging purposes).

Option 2. is really not an option for us.

As far as option 1. goes, I will evaluate installing ntpd from the opkg feeds. The problem is just that the end user may wish to change NTP servers (it's a private, non-routed subnet) so that is a somewhat ugly solution.

I was hoping an answer more like: just install package <Whatever>, and you can configure SNTP in MAX

Regards,

     Jörg

---
Jörg Heßdörfer
Certified LabVIEW Architect, S.E.A. Datentechnik GmbH
0 Kudos
Message 4 of 7
(10,372 Views)
Solution
Accepted by topic author joergh

I now solved it by installing the ntp ipkg's and configuring in /etc/ntp.conf.

---
Jörg Heßdörfer
Certified LabVIEW Architect, S.E.A. Datentechnik GmbH
0 Kudos
Message 5 of 7
(10,372 Views)

Great news!  Any chance you can give a few more details on the steps (or a copy of your config settings) for others trying to tackle the same problem? 

0 Kudos
Message 6 of 7
(10,372 Views)

Sure, here you go (Linux based controller required, assumes familiarity with opkg. If not, see for example https://decibel.ni.com/content/docs/DOC-36980 😞

1.    Enable SSH access and login to your controller (e.g. using Putty on Windows)

2.    Either configure your controller for internet access or download the ntp packages manually to the controller (you need at least ntp and ntp-tickadj, I would also recommend ntp-utils for troubleshooting)

3.    Install the packages

4.    in /etc/ntpconf, edit the first line reading 'server ...' (not the one referring to 127.127.1.1!) and replace the given address with your NTP server address (you can add multiple servers, each on it's own 'server ...' line).

5.    Restart the controller or NTPd (with '/etc/init.d/ntpd restart')

6.    Done!

You can check the sync status with 'ntpq -c peers'. See http://www.ntp.org/documentation.html for documentation on NTP and it's utils in Linux.

If you want synchronize against a WIN32TM server (Windows native time server implementation), please be aware that NTPd will refuse to do so unless you add a higher maxdist value (e.g. by adding 'tos maxdist 16' to the end of /etc/ntp.conf). If you don't need high accuracy (better than 100ms +/-) that should be OK.

Otherwise, I would recommend the Meinberg Port of the NTPd server for Windows (see http://www.meinbergglobal.com/english/sw/ntp.htm).

Hope that helps,

     Jörg

---
Jörg Heßdörfer
Certified LabVIEW Architect, S.E.A. Datentechnik GmbH
Message 7 of 7
(10,372 Views)