Adam, thank you for your suggestion, but this won’t be necessary because the PCI-1588 is syncronized to PPS. If you have more suggestions, every help will be welcome!
Josh, I am looking for a low cost GPS receiver to use with PCI-1588. Please verify if I understood well some points about the syncronization with PPS.
When the GPS sends a ZDA message of the NMEA-0183 standard (see description below) after a PPS pulse, I have to decode this message and set the initial time of the PCI-1588 with NI-Sync function. Every subsequent pulse is interpreted to be received one second later and the PCI-1588 time syncronized accordingly.
niSync_SetTimeReferencePPS (ViSession vi, ViConstString terminalName, ViBoolean useManualTime, ViUInt32 initialTimeSeconds, ViUInt32 initialTimeNanoseconds, ViUInt16 initialTimeFractionalNanoseconds);
The initialTimeSeconds is the number of seconds elapsed since Coordinated Universal Time (UTC) of January 1, 1970 (not counting leap seconds). In such case, I have to convert the UTC time (hhmmss.s, day, month and year of the ZDA message) to UNIX time as described
here using the C functions and the time_t type of time.h.
The NI-Sync driver don’t use the UTC timescale. It returns the current time using the TAI timescale. In the document
Why Is My PXI-6682 Off By 19 Seconds When Using GPS Protocol? , I found this: “If the TAI time scale does not work for your application the time source can be manually adjusted by using the NI-Sync property node and selecting "Clock Adjustment Offset". Does the PCI-1588 using PPS as Reference time accept the NISYNC_ATTR_1588_1588_CLK_ADJ_OFFSET attribute?
If I set the initial time to 1200300400.000000000 and a timestamp occurs at 1200300405.123456789, then 1200300405 is the timeSeconds and 123456789 is the timeNanoseconds. In the niSync_ReadTriggerTimeStamp function, what is the timeFractionalNanoseconds?
niSync_ReadTriggerTimeStamp (ViSession vi, ViConstString terminal, ViReal64 timeout, ViUInt32* timeSeconds, ViUInt32* timeNanoseconds, ViUInt16* timeFractionalNanoseconds, ViInt32* detectedEdge);
In my project I will use niSync_ReadMultipleTriggertimestamp, then I am going to examine the TimeStampClock-Cont.vi when someone send me the C code
in this thread.
Let me know if you had some problem with your test.
Thank you,
Lilian
-----------------------------
ZDA NMEA MessageThe GPS receiver outputs the time associated with the current 1 PPS pulse. Each message is output within 100–500 ms after the 1 PPS pulse is output and tells the time of the pulse that just occurred. The ZDA message contains UTC time, the day, the month and the year.
$GPZDA,hhmmss.s,dd,mm,yyyy,00,00*hh<CR><LF>
$GPZDA,102030.5,12,04,2008,00,00*4F<CR><LF>
Field Description
1 UTC time
2 Day (01 to 31)
3 Month (01 to 12)
4 Year
5 unused
6 unused
hh Checksum
----------------------------