DNA/DNR-IRIG-650 IRIG Timing Layer
Chapter 3
20
Programming with the Low Level API
Tel: 508-921-4600
www.ueidaq.com
Vers:
4.6
Date: March 2019
DNx-IRIG-650 Chap3x.fm
© Copyright 2019
United Electronic Industries, Inc.
one (Time Keeper measures and averages the number of base clock cycles
between externally derived 1PPS pulses when they are valid).
3. If external timebase is not derived from the timecode and if its external time-
base is slower than 1PPS, then use the
CT650_TKFLG_SUBPPS
flag.
4. If BCD data in the incoming timecode is corrupted, use the flag
CT650_TK-
FLG_USESBS
to force the use of SBS for TK hour/min decoding.
5. If you know that seconds, minutes or days information is invalid in the input
timecode, use the flags:
CT650_TKFLG_SEC_INVALID
,
CT650_TKFL-
G_MIN_INVALID
or
CT650_TKFLG_DAY_INVALID
.
This is an example of how to set the Time Keeper for internal timebase:
mode = CT650_TKPPS_INTERNAL;
flags = CT650_TKFLG_AUTOFOLLOW|CT650_TKFLG_USENOMINAL;
ret = DqAdv650ConfigTimekeeper(hd, devn, mode, flags);
3.2.1.2
Get time from
Time Keeper
Once that the Time Keeper is enabled the user can set and read time from it.
There are two functions available to read time.
The first function to read time is:
ret = DqAdv650GetTimeSBS(hd, devn, &seconds, µ,
&dayofyear, &year, &tkstatus);
This function returns seconds from the beginning of the day, microseconds
within the last second at the moment of function call, day of the year, year and
the status of the Time Keeper.
The following Time Keeper status conditions are defined:
1.
CT650_TKSTS_BIN2BCD_ERR
- binary time code is invalid (sticky)
2.
CT650_TKSTS_BCD2BIN_ERR
- BCD time code is invalid (sticky)
3.
CT650_TKSTS_TK_ERR
- time code received mismatch current time (sticky)
4.
CT650_TKSTS_1PPS_GEN
- 1pps was generated (sticky)
5.
CT650_TKSTS_1PPS_RCV
- selected 1pps was received (sticky)
6.
CT650_TKSTS_TC_RCV
- external time code was received and applied
(sticky)
7.
CT650_TKSTS_1PPS_ADVAL
- 1pps output of adaptive PLL in TK is valid
8.
CT650_TKSTS_PPS_LOST
- 1pps was not detected within last validation
interval
9.
CT650_TKSTS_AVG_INVAL
- if averaged 1pps does not pass validation cri-
teria
10.
CT650_TKSTS_1PPS_INVAL
- last detected external 1pps was invalid
Bits marked as “sticky” are set when condition is met and cleared upon read
from the status register. Thus, if you call
DqAdv650GetTime…()
in a short
period of time between calls, only those bits that were detected will be present
on the second call.
CT650_TKSTS_TK_ERR
is always generated upon synchronization with external
timecodes or for IRIG codes with sub-PPS frame rates. For IRIG-B
0x700
code
normal, for sub-PPS and high frame rate codes, 1PPS invalid warnings might be
set.