DNA/DNR-IRIG-650 IRIG Timing Layer
Chapter 3
24
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.
pDataDef
defines timecode data and the internal location of this data in the
registers:
typedef struct {
char timecode_name[32];
// timecode name
uint32 val_table_sz;
// timecode table size
// timecode table (128 bits maximum)
CT650_VALID_TABLE val_table[CT650_VAL_MAX];
} CT650_IRIG_CODE_DEF, *pCT650_IRIG_CODE_DEF;
The maximum size of the table is 128 characters while the longest code used is
120 characters.
The timecode is represented by
CT650_VALID_TABLE
structure:
typedef struct {
uint16 cmd;
// command
uint16 bit;
// bit number (in TK TREGx)
uint16 reg;
// TREG number
uint16 desc;
// data description
} CT650_VALID_TABLE, *pCT650_VALID_TABLE;
For example, IRIG-B code is described as follows:
CT650_IRIG_CODE_DEF irig_b_bcd_cf_sbs = {
"IRIG B",
100,
{
// Command, Bit, Register, Description
// == BCD seconds: ==
// position 99 P0
{ CT650_VAL_P, BCD_NoP_b(), BCD_NoP_r(), BCD_NoP_d()},
// position 0 Pr
{ CT650_VAL_P, BCD_NoP_b(), BCD_NoP_r(), BCD_NoP_d()},
// position 1 unit seconds
{ CT650_VAL_01,BCD_SEC_b(0),BCD_SEC_r(0),BCD_SEC_d(0)},
// position 2
{ CT650_VAL_01,BCD_SEC_b(1),BCD_SEC_r(1),BCD_SEC_d(1)},
// position 3
{ CT650_VAL_01,BCD_SEC_b(2),BCD_SEC_r(2),BCD_SEC_d(2)},
// position 4
{ CT650_VAL_01,BCD_SEC_b(3),BCD_SEC_r(3),BCD_SEC_d(3)},
// position 5
{ CT650_VAL_NOP,BCD_NoP_b(),BCD_NoP_r(), BCD_NoP_d() },
// position 6 tens seconds
{ CT650_VAL_01,BCD_SEC_b(4),BCD_SEC_r(4),BCD_SEC_d(4)},
// position 7
{ CT650_VAL_01,BCD_SEC_b(5),BCD_SEC_r(5),BCD_SEC_d(5)},
// position 8
{ CT650_VAL_01,BCD_SEC_b(6),BCD_SEC_r(6),BCD_SEC_d(6)},
// == BCD minutes: ==
// position 9 P1
{ CT650_VAL_P, BCD_NoP_b(), BCD_NoP_r(), BCD_NoP_d()},
// position 10 unit minutes
{ CT650_VAL_01,BCD_MIN_b(0),BCD_MIN_r(0),BCD_MIN_d(0)},
…