Configuring CompactRIO to Synchronize Clocks with NTP Servers

14
Configuring CompactRIO to Synchronize Clocks with NTP Servers Bryan Heslop Business Development Manager Systems Engineer Endigit

Transcript of Configuring CompactRIO to Synchronize Clocks with NTP Servers

Page 1: Configuring CompactRIO to Synchronize Clocks with NTP Servers

Configuring CompactRIO to Synchronize Clocks

with NTP ServersBryan Heslop

Business Development ManagerSystems Engineer

Endigit

Page 2: Configuring CompactRIO to Synchronize Clocks with NTP Servers

Agenda• Introduction to Endigit• What is NTP?• Easy cRIO NTP Config – Internet connection required• Less easy cRO NTP Config – No Internet on cRIO• Looking at NTP time information• Checking NTP time settings in LabVIEW

Page 3: Configuring CompactRIO to Synchronize Clocks with NTP Servers

Endigit• Founded in 2011• National Instruments Silver Alliance Partner• 5 Certified LabVIEW Architects• 1 Certified LabVIEW Embedded Developer• 2 National Instruments Certified Professional Instructors

Page 4: Configuring CompactRIO to Synchronize Clocks with NTP Servers

What Endigit offers

Services• LabVIEW Development• Data Acquisition Systems• Automated Test Consulting• Industrial and Embedded

Control• Vision Systems

Industries• Aerospace and Defense• Medical• Industrial Control• Consumer Electronics• Oil and Gas

Page 5: Configuring CompactRIO to Synchronize Clocks with NTP Servers

ProductsIP Blaster is a utility for quickly and easily setting a static IP address on a Windows system.

Endigit BACnet LabVIEW API

SquareBattle is a game written in LabVIEW where you create your own team of squares to compete against other peoples teams in an arena.

Endigit EMC Test Suite

Page 6: Configuring CompactRIO to Synchronize Clocks with NTP Servers

What is NTP?• NTP is a protocol designed to synchronize the clocks of computers

over a network to a common timebase (usually UTC).• There is a daemon that can run on Unix/Linux operating systems.

Image Source: https://www.endruntechnologies.com/pdf/NTP-Intro.pdf

Page 7: Configuring CompactRIO to Synchronize Clocks with NTP Servers

Easy CompactRIO NTP Configuration• NI Real-time Linux CompactRIOs have configuration for the NTP

daemon installed.• cRIO-906x, cRIO-903x devices

• Connect cRIO to the Internet• Run command: opkg install ntp ntp-tickadj ntp-util ntpdate• Run opkg update

• Edit /etc/ntp.conf file• Enter command vi /etc/ntp.conf• Add IP address for desired time server (default config file has official ntp

servers already)

Page 8: Configuring CompactRIO to Synchronize Clocks with NTP Servers

What if I can’t connect my cRIO to the Internet?• Download files from ni.com on PC and copy them over to cRIO• libevent• libperl• ntp• ntp-tickadj• ntp-utils• Perl• ntpdate

• http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/• http://download.ni.com/ni-linux-rt/feeds/2016/x64/ipk/core2-64/

Page 9: Configuring CompactRIO to Synchronize Clocks with NTP Servers

No Internet manual install• Manually install each package in correct order of dependencies• opkg install libevent• opkg install ntp-tickadj• opkg install ntp• opkg install libperl• opkg install perl• opkg install ntp-utils• opkg install ntpdate

Page 10: Configuring CompactRIO to Synchronize Clocks with NTP Servers

Edit /etc/ntp.conf• vi /etc/ntp.conf• Add your server• Server <ipaddress>

Page 11: Configuring CompactRIO to Synchronize Clocks with NTP Servers

NTP commands and information• /etc/init.d/ntpd• daemon that runs to sync with server• /etc/init.d/ntpd stop• /etc/init.d/ntpd start

• ntpdate -s <server>• Forces a synch to the server time

• ntpq -p• Gets list of peers and shows status

Page 12: Configuring CompactRIO to Synchronize Clocks with NTP Servers

What does all that stuff mean?• remote and refid: remote NTP server, and its NTP server• st: stratum of server• t: type of server (local, unicast, multicast, or broadcast)• poll: how frequently to query server (in seconds)• when: how long since last poll (in seconds)• reach: octal bitmask of success or failure of last 8 queries (left-shifted);

• 377 = 11111111 = all recent queries were successful • 257 = 10101111 = 4 most recent were successful, 5 and 7 failed

• delay: network round trip time (in milliseconds)• offset: difference between local clock and remote clock (in milliseconds)• jitter: difference of successive time values from server (high jitter could be due to an

unstable clock or, more likely, poor network performance)

Page 13: Configuring CompactRIO to Synchronize Clocks with NTP Servers

Can I get this information in LabVIEW?

Page 14: Configuring CompactRIO to Synchronize Clocks with NTP Servers

Endigit contact information• Bryan Heslop – [email protected]• 801-787-3111• www.endigit.com• Blog.endigit.com