DNA/DNR-IRIG-650 IRIG Timing Layer
Chapter 3
22
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.
3.2.2
Input
Programming
When programming the Time Decoder, the first thing you’ll need to do is to select
a timecode as a time source of the Time Keeper (TK). Otherwise, it will not
receive a timecode from the input stream.
We’ve seen in the previous section that we program the Time Keeper by calling
the function
DqAdv650ConfigTimekeeper()
; for example:
mode = CT650_TKPPS_TIMECODE;
// TK mode: ext, <= 1PPS
flags = CT650_TKFLG_AUTOFOLLOW|CT650_TKFLG_USENOMINAL;
ret = DqAdv650ConfigTimekeeper(hd, devn, mode, flags);
Then, the Time Decoder needs to be programmed:
mode = CT650_IN_ENABLED;
// timecode input: enable
ret = DqAdv650SetTimecodeInput(hd, devn, mode, td_input,
pPrmDef, pDataDef);
The input
<td_input>
can be taken from one of the following sources:
•
CT650_IN_AM
- Time code is an amplitude modulated (AM) signal
•
CT650_IN_M2_RF0
- Manchester II code on RFIn0 (Ext Clk In) input
•
CT650_IN_M2_RF1
- Manchester II code on RFIn1 (Rxt Trig In) input
•
CT650_IN_M2_IO0
- Manchester II code on TTLIn0 input
•
CT650_IN_M2_IO1
- Manchester II code on TTLIn1 input
•
CT650_IN_NRZ_RF0
- NRZ code on RF0 (Ext Clk In) input
•
CT650_IN_NRZ_RF1
- NRZ code on RF1 (Ext Clk In) input
•
CT650_IN_NRZ_IO0
- NRZ code on TTLIn0 input
•
CT650_IN_NRZ_IO1
- NRZ code on TTLIn1 input
The parameters
<pPrmDef>
and
<pDataDef>
are explained in the next sec-
tion.
3.2.2.1
Timecode
definitions
(for input)
The following two parameters define the type of data expected in the timecode.
The first one is
pPrmDef
, which defines timecode parameters (see DaqLibHL-
TimeCodes.h):
// Timecode Parameters
typedef struct {
char tcode_name[32];
// timecode name
char tcode_subtype[32];
// timecode signal
double bit_frq;
// timecode bit rate, Hz
double frame_frq;
// timecode frame rate, Hz
double carrier_frq;
// carrier frequency
uint32 ratio_f_er;
// frequency to code bit ratio
uint32 logic_0;
// number of cycles for logic_0
uint32 logic_1;
// number of cycles for logic_1
uint32 pos_id;
// num cycles for position identifier
int is_bcd;
// TRUE if BCD code is present in data
int is_cf;
// TRUE if CF codes are present
int is_sbs;
// TRUE if SBS is present
int is_year;
//TRUE if CF chars 50-58 have BCD year data
} CT650_IRIG_PRM_DEF, *pCT650_IRIG_PRM_DEF;