Configuring CompactRIO Real-Time Controllers to Synchronize to SNTP Servers
Hardware: CompactRIO>>Controllers
Problem: Is it possible to configure CompactRIO Real-Time controllers to use an SNTP or other time server?
Solution: As of LabVIEW Real-Time 8.6, CompactRIO Real-Time controllers can be configured to synchronize to SNTP servers.
To configure the controller to synchronize to an SNTP server, go through the following steps:
- FTP the ni-rt.ini file of the controller to your Windows machine. To do the FTP go through the steps below:
- Go to Measurement and Automation Systems and expand Remote Systems. You should be able to see your CompactRIO there.
- Right-click on it and select File Transfer. You will get a pop-up window like the one shown below.

- As visible in the image above, the ni-rt.ini file is present in the root-level directory of the controller. Select that file for transfer and click To Local. This will transfer the file to your Windows system to the directory of your choice that you can specify in the Current Local Directory section.
- Add the following lines to the ni-rt.ini file of the controller in the time sync section at the bottom.
[TIME SYNC]
source_priority = sntp;rtc;
source.sntp.enable = true
source.sntp.address = 10.0.58.1
source.sntp.interval = 60
source.sntp.port = 123
source.sntp.verbose = false
source.sntp.log = false
- FTP the modified file back to the controller by calling the ftp client from Measurement and Automation Explorer as described before and clicking on To Remote. After updating the ni-rt.ini file and rebooting, the cRIO controller will automatically implement synchronization to the SNTP server.
The following table describes the .ini tokens:
| Token |
Type |
Default |
Importance |
Description |
| source_priority |
string |
sntp |
REQUIRED |
Lists the relative priority of installed time sync plug-ins. For cRIO, the possible options are rtc, dio, and sntp. |
| source.sntp.enable |
bool |
false |
REQUIRED |
Set to true to enable the sntp time sync plug-in. Set to false to disable. |
| source.sntp.address |
string |
0.0.0.0 |
REQUIRED |
Specifies the ipv4 address of the SNTP time server. Use "." delimited address. Using a named address, like "pool.ntp.org" does not work at this time. |
| source.sntp.interval |
int |
60 |
Recommended |
By default the SNTP client driver sleeps for an interval between successive time server polls. Set a new delay, specified in seconds, to adjust the interval. |
| source.sntp.port |
int |
123 |
optional |
By default SNTP uses a known port to contact the time server. Set a new port number if the time server is on a non-standard port. |
| source.sntp.verbose |
bool |
false |
optional |
By default SNTP client driver errors are silently discarded. Set to true to enable verbose errors. |
| source.sntp.log |
bool |
false |
optional |
Set to true to log timestamps to a file. This should only be used for debugging purposes. |
The SNTP is a simplified subset of the Network Time Protocol (NTP). For more information on SNTP refer to RFC 2030. Additional options for other Time Servers can be found in the related links section below.
Related Links: Developer Zone Example Program: PXI TIME Setting
Developer Zone Tutorial: Synchronizing Multiple CompactRIO Chassis
Developer Zone Example Program: Set Date and Time on PC, PXI, and PXI-RT Using DAYTIME Protocol
Developer Zone Tutorial: Getting/Setting the System Date/Time on CVS, PXI RT Targets
KnowledgeBase 493BIHLX: Using the SMB Connector for Digital I/O or Drift Compensation on cRIO-901x and 9074 Controllers
External Link: NIST Internet Time Servers
Attachments:
Report Date: 05/04/2007
Last Updated: 02/20/2009
Document ID: 493C8ELX