From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Sync Labs

cancel
Showing results for 
Search instead for 
Did you mean: 

NI TimeSync: FPGA Timekeeper 1.1b0 library precision error

Recently, working with the FPGA Timekeeper 1.1b0.zip library I detected an error up to hundred of nanoseconds, in my case I detected a maximum of 119ns but it can be higher, in the "LabVIEW Time to FPGA Time.vi" VI of the library.

 

This VI is used in the RealTime block diagram to convert labview time to FPGA time (TAI format based, referenced to 1/1/1970):

 

Timekeeper1.png

 

The problem seems that comes from an incorrect type conversion that introduce some error in the precisión of the data. Using the next block diagram, if you enter a labview time of 1st January 1970 at 00:00:00 the number of nanoseconds from 1/1/1970 00:00:00 returned is correct and equal to 0, but if you enter the same date plus 1 second and 1 nanosecond this VI must return a value of 1E+9 (for 1 second) plus 1 nanosecond, that is 1000000001 and the VI return a value of 1000000000, missing the nanosecond. Testing different dates and times I get a maximum error of 119ns in the conversion. This is the code used to test this error:

 

timekeeper4.jpg

In the frontpanel you can see the error conversion. Take into account that for my time zone, CET, for a UTC time of 00:00:00 I had to enter 01:00:00 as the time, so you can see in the fractional seconds fields and in the FPGA time (ns) fields the difference between the real UTC datetime entered, the time in nanoseconds from the VI of the library and the good time conversion done with my modification of the code of the vi of the library:

 

Timekeeper3.png

 

The block diagram of the "LabVIEW Time to FPGA Time.vi" is the following:

 

Timekeeper5.png

 

The data conversion from LabVIEW time to double is not enough to mantein the precision of the data, so replacing these "To double precision format" converters for "To extended precision format" converters solve the problem, as I see you in the following block diagram:

 

Timekeeper6.png

 

I told with National Instruments support department but they reject to modify the library to correct this issue so I post the issue here hoping this solution can help to the community.

 

Engineer at Airbus Group
Message 1 of 4
(2,991 Views)

Thanks jlgalin for posting your findings!

 

Kudos

Vincent Carpentier, Ing./Eng.
CLA, CPI
Neosoft Technologies
www.neosoft.ca
DQMH Trusted Advisor
0 Kudos
Message 2 of 4
(2,966 Views)

Hello jlgalin

 

Thanks for your time, I hope that this forum will me useful for ther users

 

I suggest you to also post this on https://forums.ni.com/t5/LabVIEW-Idea-Exchange/idb-p/labviewideas

 

Good day

0 Kudos
Message 3 of 4
(2,951 Views)

Thank you for raising this issue. Did they give a reason why they reject the modification?

0 Kudos
Message 4 of 4
(247 Views)