DNA/DNR-IRIG-650 IRIG Timing Layer
Chapter 3
34
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.6
Event
programming
(sync & async)
The IRIG-650 implements an extensive event generation and recording system.
There are two ways of using events:
1. Synchronous events: when the user configures events and then either
reads event status registers, or reads events stored in the event FIFO.
Additionally, events can be routed to TTL Out or SYNCx lines to be used for
synchronization and time-related purposes. Synchronous events can be
used to trigger selected layers to start or stop acquisition at an exact time
provided by an IRIG-B source (or time extracted from a GPS signal).
2. Asynchronous events: when the user configures events to be received
asynchronously and then waits for the event packet (on a dedicated UDP
port that is different from the main UDP port where most other traffic goes).
Asynchronous events are mainly used to drive real-time systems from pre-
cise clocks as well as to inform the user about unexpected timecode errors.
On a Windows XP SP3 platform running on a 2GHz Intel Core2 Quad CPU,
a measured delay of 80µs between time event and thread invocation was
achieved 99.5% of the time. The actual performance may vary depending
on the performance of the host system, system load, and the type of IOM
used (MPC5200 – 100-base-T or MPC8347 – 1000-Base-T)
The IRIG-650 layer can use four Event modules (as channels 0 to 3) to create
timed interrupts and provide synchronization signals to the outside world.
Additionally, a dedicated event module is used to provide clocking to the input
channel list, allowing it to save timestamp information with 10µs resolution by
default (
DQ_LN_10us_TIMESTAMP
with the
DQL_TMRCFG_TSTS_66M
source)
or to a custom resolution by using the
DqCmdResetTimestamp
function.
Each event can generate up to two sub-events, each with programmable delay,
the main event starts a countdown (delay) after which each sub-event is fired.
Events may be set in one-time (alarm) or repeat mode.
For special logics, by using masks, events can repeat every year/day/hour/
minute or second; they can also be triggered by a special condition on the DNA
bus and/or global start/stop trigger.
Table 3-1
provides a summary of event registers. Registers and their bits are
represented by color groups that differ for different event sources.
3.2.6.1
Programming
Events
To program events, pass the
<event>
structure as an argument to the function:
DqAdv650SetEvents(hd,devn, evt_chan, flags, &event, ¶m)
for which the valid event channel
<evt_chan>
can be set to 0,1,2, or 3.
The
<event>
structure is defined as:
typedef struct {
uint32 event_cfg;
// event configuration bitfield
uint32 event_prm;
// event parameters
uint32 event_val;
// parameter-dependent value
uint32 event_sub0_dly;
// subevent 0 delay
uint32 event_sub1_dly;
// subevent 1 delay
} EV650_CFG, *pEV650_CFG;
Table 3-1
summarizes possible structure values that depend on the mode of
operation. The structure values are described on the following pages. Notice
that the same fields can have a different meaning based on the
<event_cfg>
mode of operation.