A time reference is software on a device which manages synchronization using a supported synchronization protocol. NI-Sync is a driver which can be used to monitor and configure time references on a target. Time references have a few considerations which are helpful to understand:
For embedded devices, the two supported time references are NI-TimeSync Time Reference for IEEE 1588-2008 and NI-TimeSync Time Reference for IEEE 802.1AS-2011. These time references may be installed to a supported Real-Time target through the Real-Time Software Wizard, and are available by default on cDAQ 9189/5 and FieldDAQ devices using firmware 18.6 and later. Only TSN-enabled devices support 802.1AS. Devices which are not TSN-enabled are capable of using IEEE 1588-2008 without hardware timestamping, but it will be less precise than on TSN-enabled devices.
The NI-Sync API exposes protocol properties in the LabVIEW programming environment. The NI-Sync API can be used for monitoring and configuring time references starting with the NI-Sync 18.0 release. For instructions on configuring time references using older versions of the NI-Sync or NI-TimeSync driver, please refer to Using NI-TimeSync to Configure IEEE 1588 and 802.1AS Time References.
Starting with NI-Sync 19.0, NI-TimeSync features are included in the NI-Sync 19.0 distribution and NI-TimeSync no longer exists as standalone software. The NI-Sync driver provides time references and examples to demonstrate how to monitor and configure time references. To install the NI-Sync API and time references for Real-Time targets, install the latest version of the NI-Sync driver on a host computer. If software older than version 19.0 is required, download the most appropriate version of NI-Timesync .
The NI-Sync API is the recommended way to monitor and configure time references with software later than NI-Sync and NI-TimeSync 18.0. To monitor or configure properties for a time reference, follow the steps below to open a session with the device and access properties.
The following table is a noncomprehensive list of useful properties for 802.1AS and 1588.
Property Name | Property Description |
Priority1* | The 1st order priority assigned to the PTP clock used by the time reference specified in Active Item. This property is used in the execution of the best master clock algorithm. A lower value increases the priority. |
Priority2* | The 2nd order priority assigned to the PTP clock used by the time reference specified in Active Item. This property is used in the execution of the best master clock algorithm. A lower value increases the priority. |
Offset from TR (ns) | Returns the time offset between a slave and a master in nanoseconds. Will always return 0 if a target is the master of a network. |
GM Clock ID* | Returns the MAC address of the grandmaster. If the target is the grandmaster, returns the target's own MAC address. |
Is TR Selected* | Indicates whether the active item is selected or not. If a time reference is selected, it is driving time on the target. Time references in master mode will never be selected, because they are not driving time on the target. The master drives time on other targets, a time reference in slave mode drives time on its own target. |
TR Enabled* | Indicates whether a TR is enabled or not. If a TR is disabled, it is effectively turned off. It will not master or slave with other targets and does not affect time on the target. |
Selected Time Interface Name | Returns the name of the selected time reference, which can be used to specify the active item. The selected time reference is the time reference which is driving time on the target. |
*The user must specify an Active Item to use this property
An example of monitoring and configuring some of these properties can be found in the LabVIEW example finder, in the task tree at Hardware Input and Output >> Timing and Synchronization >> Time-based >> Monitor and Configure Time References.vi.
In applications where synchronization is vital, it should be monitored continuously to validate synchronization quality. There are two important properties which largely define the synchronization status of a device:
Users should define their own standard of synchronization quality. An example of how to monitor synchronization quality can be found in the LabVIEW example finder, in the task tree at Hardware Input and Output >> Timing and Synchronization >> Time-based >> Monitor Synchronization.vi.
If synchronization quality is not acceptable or if other processes are being affected by poor synchronization (such as DAQmx), synchronization troubleshooting may be required to track down the issue. To effectively troubleshoot a synchronization issue, simplify the system as much as possible and rebuild the system one step at a time until the problem reappears. There are a few issues that commonly affect synchronization quality: