EDT, Inc.
2019 April 29
36
VisionLink F-series
Appendix C: Timestamping
For the IRIG footer, this will be...
image width x height x bytes per pixel
NOTE
For VisionLink frame grabbers, the DMA size must be a multiple of 8 bytes; therefore, with or without the IRIG option
enabled, the image size must be a multiple of 8 bytes.
To automatically enable IRIG functionality, you can use
pdv_set_header_type
:
int pdv_set_header_type(PdvDev *pdv_p, int header_type, int irig_slave, int irig_off-
set, int irig_raw)
For example...
int ret = pdv_set_header_type(pdv_p, HDR_TYPE_IRIG2, 1, 2, 0);
See the
simple_irig2.c
source code file for example code that shows how to use this functionality.
pdv_irig.c, pdv_irig.h
The functions below are included in
pdv_irig.c.
To reset the frame counter to 0, enter...
int pdv_reset_dma_framecount(PdvDev *pdv_p)
To set the IRIG format to packed BCD values if the value
bcd
is not zero (otherwise the format is Unix seconds since
1/1/1970), enter...
int pdv_irig_set_bcd(PdvDev *pdv_p, int bcd)
To compute the offset of the IRIG footer and return a pointer to its memory (since this in the DMA stream from the board,
this pointer will be overwritten when this buffer is used again), enter...
irig2Record *pdv_irig_get_footer(PdvDev *pdv_p, u_char *imagedata)
To compute the Unix time from the counts values in the footer and places the result in footer > timestamp (and the
timestamp value is also returned by the function), enter...
double pdv_irig_process_time(Irig2Record *footer)
To clear the error flags
had_irig_error
and
had_pps_error
( “sticky” bits, indicating respective errors in the
IRIG transfer or the 1 pps signal), enter...
void pdv_irig_reset_errors(PdvDev *pdv)
To set the board in slave mode to use 1 pps or IRIG-B values received from another EDT board, rather than from the
Lemo connector (note
–
this function requires a special cable from EDT), enter...
void pdv_irig_set_slave(PdvDev *pdv_p, int onoff)
To use the direct register access to the current time value to fill in an Irig2Record structure (with the valid elements being
counts, tickspps, status, and the IRIG seconds / bcd values), enter...
void pdv_irig_get_current(PdvDev *pdv_p, Irig2Record *footer)
irigdump.c
The EDT PDV driver also contains a simple example program named
irigdump.c.
This program, based on
simple_take.c,
exercises most of the functions described above.
To display the command line arguments, run
irigdump -help.