MX Foundation 4
|
IRIG-B timebase is normally used when time correlation with other equipment is necessary.
In order to use IRIG-B synchronization as timebase, the application must enable the IRIG-B input by setting the KMXF_DEVICE_IRIGB_INPUT_SIGNAL attribute for the device. The IRIG-B signal must be locked before setting the timebase to IRIG-B. The IRIG-B status can be monitored using the mxfDeviceIrigbStatusGet() function.
The precision of the system timing is related by two factors; the IRIG-B equipment and carrier VCXO.
With the device IRIG-B decoder and firmware, the system can auto-calibrate itself to the IRIG-B signal and thus provide a precision of 5 µs precision/stability at all time.
In all IRIG-B modes, the IRIG-B state-machine tracks the phase of the signal and cumulates it.
If, at a certain point, the cumulating phase value is out of the attribute KMXF_DEVICE_IRIGB_DRIFT_MAX range, the IRIG-B state-machine unlocks from the IRIG-B signal (the mxfDeviceIrigbStatusGet() function will return a status different from MXF_IRIGB_LOCKED and MXF_ASYNCEVENT_IRIGB_EVENT_UNLOCKED asynchronous event will be set).
Between the unlock event and until the next lock event, the RTC will be in free running mode. During this time, the RTC might drift from the IRIG-B time. At the lock event, the user can call the mxfSystemTimeBaseSet() function again to compute a new offset with the new lock time. This might cause a non-linearity between the data time tags.
When the mxfSystemTimeBaseSet() function is called to set the timebase to IRIG-B, a correlation between the RTC on the device and the last IRIG-B lock time is done and an offset is computed from that.
This computed offset includes the number of seconds elapsed since January 1st, 1970 (86400 seconds per day from the device time), counting leap years and excluding the current year. The IRIG-B time however is a very precise time based on atomic clock but the precision is only at the second.
The enhanced format of the internal IRIG-B time in binary of the time value is then computed as follow;
IRIG-B time = [Years Days Minutes Seconds] from the IRIG-B time + [leap seconds] + [offset] from the device clock.
This works because there is a process to control the RTC on the device to keep it locked to the IRIG-B time by using a VCXO.
Therefore, you don't have to adjust the time tag with leap seconds, because the offset was computed only once at the beginning. If a leap second happens during the acquisition of data, the time tags will now have one second offset with the IRIG-B time. Asynchronous events for MXF_ASYNCEVENT_IRIGB_EVENT_LEAP_SECOND_INS and MXF_ASYNCEVENT_IRIGB_EVENT_LEAP_SECOND_DEL are generated and can be used to save the time at which the event occurred and adjust the time tags in post-processing.
Input supported format: B00X and B12X.
Format | Modulation Frequency | Frequency/Resolution | Coded Expressions |
---|---|---|---|
B | 0 (Pulse width code) [TTL] | 0 (No carrier) | 0 (BCDTOY, CF, SBS) * |
B | 0 (Pulse width code) [TTL] | 0 (No carrier) | 1 (BCDTOY, CF) * |
B | 0 (Pulse width code) [TTL] | 0 (No carrier) | 2 (BCDTOY) |
B | 0 (Pulse width code) [TTL] | 0 (No carrier) | 3 (BCDTOY, SBS) * |
B | 0 (Pulse width code) [TTL] | 0 (No carrier) | 4 (BCDTOY, BCDYEAR, CF, SBS) * |
B | 0 (Pulse width code) [TTL] | 0 (No carrier) | 5 (BCDTOY, BCDYEAR, CF) * |
B | 0 (Pulse width code) [TTL] | 0 (No carrier) | 6 (BCDTOY, BCDYEAR) |
B | 0 (Pulse width code) [TTL] | 0 (No carrier) | 7 (BCDTOY, BCDYEAR, SBS) * |
B | 1 (Sine wave, amplitude modulated) [AM] | 2 (1 kHz/1 ms) | 0 (BCDTOY, CF, SBS) * |
B | 1 (Sine wave, amplitude modulated) [AM] | 2 (1 kHz/1 ms) | 1 (BCDTOY, CF) * |
B | 1 (Sine wave, amplitude modulated) [AM] | 2 (1 kHz/1 ms) | 2 (BCDTOY) |
B | 1 (Sine wave, amplitude modulated) [AM] | 2 (1 kHz/1 ms) | 3 (BCDTOY, SBS) * |
B | 1 (Sine wave, amplitude modulated) [AM] | 2 (1 kHz/1 ms) | 4 (BCDTOY, BCDYEAR, CF, SBS) * |
B | 1 (Sine wave, amplitude modulated) [AM] | 2 (1 kHz/1 ms) | 5 (BCDTOY, BCDYEAR, CF) * |
B | 1 (Sine wave, amplitude modulated) [AM] | 2 (1 kHz/1 ms) | 6 (BCDTOY, BCDYEAR) |
B | 1 (Sine wave, amplitude modulated) [AM] | 2 (1 kHz/1 ms) | 7 (BCDTOY, BCDYEAR, SBS) * |
*: only the BCDTOY and BCDYEAR (if available) parts will be decoded.
The example uses the Flex IRIG-B generator and loopback capability to demonstrate how to use IRIG-B timebase.
mil1553_bc_rt_data_assignment.c
IRIG-B can post asynchronous events when a condition is registered using the mxfAsyncEventConditionsSet() function for trapping events.
The following events for IRIG-B can be reported;
Async Event | Description |
---|---|
MXF_ASYNCEVENT_IRIGB_EVENT_LOCKED | When the IRIG signal was detected and is now locked. |
MXF_ASYNCEVENT_IRIGB_EVENT_UNLOCKED | When the IRIG signal is unlocked; this can be a permanent condition (cable unplugged) or a transient condition (cloud). In both cases the IRIG-B logic changes its state to free running until a signal lock occurs. |
MXF_ASYNCEVENT_IRIGB_EVENT_LEAP_SECOND_INS | Positive leap second reported.* |
MXF_ASYNCEVENT_IRIGB_EVENT_LEAP_SECOND_DEL | Negative leap second reported.* |
*The leap second is verified at the end of each day, regardless of the month. It is up to the user to confirm that the leap second detected is in fact a real leap second and not an erroneous value of the IRIG-B frame by checking with International Earth Rotation and Reference Systems Service (IERS). The IRIG-B time includes all preceding leap seconds. So, at this point, you do not have to adjust the time tag with leap seconds, but since the offset is computed only once at the beginning, if a leap second happens during the acquisition of data, the time tags will now have one second offset with the IRIG-B time. The MXF_ASYNCEVENT_IRIGB_EVENT_LEAP_SECOND_INS and MXF_ASYNCEVENT_IRIGB_EVENT_LEAP_SECOND_DEL asynchronous events can be used to save the time at which the event occurred and adjust the time tags in post-processing.
The example below shows how an IRIG-B asynchronous handler can be implemented.
This first example is the handler itself and the following example shows how an application can register the conditions for calling this handler.
The following IRIG-B attributes are available.
The KMXF_DEVICE_IRIGB_INPUT
attribute selects which IRIG-B input is used to synchronize the device timer with the IRIG-B signal.
The supported values are:
Constant | Definition |
---|---|
VMXF_DEVICE_IRIGB_INPUT_NONE | IRIG-B not used (default) |
VMXF_DEVICE_IRIGB_INPUT_DEVICE | Use Device input |
The application should wait that the status returned by the mxfDeviceIrigbStatusGet() function is MXF_IRIGB_STATUS_LOCKING or MXF_IRIGB_STATUS_LOCKED before calling any other functions.
The KMXF_DEVICE_IRIGB_INPUT_SIGNAL
attribute designates the IRIG-B signal type to be used by the selected IRIG-B input.
The IRIG-B input must be selected before the selection of the signal type.
The supported values are:
Constant | Description |
---|---|
VMXF_DEVICE_IRIGB_INPUT_SIGNAL_AM | AM signal (default) |
VMXF_DEVICE_IRIGB_INPUT_SIGNAL_AM_1PPS | AM and 1 PPS signals |
VMXF_DEVICE_IRIGB_INPUT_SIGNAL_DIGITAL | Digital signal |
The KMXF_DEVICE_IRIGB_PHASE_COMPENSATION
defines the IRIG-B input phase compensation. The value is expressed according to the timebase resolution. The effective value is truncated according to the timebase resolution.
It is a positive adjustments to move the device timer, module timer and module time tag earlier.
The supported range is:
Range | Value (ns) |
---|---|
Minimum | -1000000000.0 |
Maximum | 1000000000.0 |
Default value: 0.0 ns
The KMXF_DEVICE_IRIGB_GEN_BCD_TIME
attribute controls the IRIG-B TTL generator BCD Time. This attribute should be used to set the starting IRIG-B time to generate when IRIG-B generator is enabled.
The format is as follow:
Digit | Position |
---|---|
Seconds | 0-3 |
Tens of Seconds | 4-6 |
Minutes | 7-10 |
Tens of Minutes | 11-13 |
Hours | 14-17 |
Tens of Hours | 18-19 |
Days | 20-23 |
Tens of Days | 24-27 |
Hundreds of Days | 28-29 |
Years | 32-35 |
Tens of Years | 36-39 |
Hundreds of Years | 40-43 |
Thousands of Years | 44-47 |
Default value: 0
The KMXF_DEVICE_IRIGB_GEN_ENABLE
attribute controls the IRIG-B TTL generator enable state. When enabled, the IRIG-B generator generates IRIG-B frame by starting with the value set in KMXF_DEVICE_IRIGB_GEN_BCD_TIME.
The supported values are:
Constant | Value |
---|---|
VMXF_ENABLE | Enable IRIG-B Generator |
VMXF_DISABLE | Disable IRIG-B Generator (default) |
The KMXF_DEVICE_IRIGB_GEN_LOOPBACK_ENABLE
attribute controls the IRIG-B TTL internal loopback.
When enabled, IRIG-B generator must also be enabled to receive IRIG-B TTL signal without the need to be externally connected to an IRIG-B source.
The supported values are:
Constant | Value |
---|---|
VMXF_ENABLE | Enable IRIG-B Generator loopback |
VMXF_DISABLE | Disable IRIG-B Generator loopback (default) |
The KMXF_DEVICE_IRIGB_YEAR_DECODING_ENABLE
attribute controls the decoding of the year from the IRIG-B frame.
The supported values are:
Constant | Value |
---|---|
VMXF_ENABLE | Enable Year decoding from IRIG-B frame. The IRIG-B frame must be compliant to IRIG 2004 specification. |
VMXF_DISABLE | Disable Year decoding from IRIG-B frame (default) |
The KMXF_DEVICE_IRIGB_YEAR_RANGE_MIN
attribute specifies the base year value from which the two year digits from the IRIG-B frame will be added.
The supported range is:
Range | Value (year) |
---|---|
Minimum | 1970 |
Maximum | 2999 |
Default value: 2000
The KMXF_DEVICE_IRIGB_TIMEOUT
attribute specifies the time in seconds, based on the timebase resolution, after which a stalled signal will be reported as a lost of signal.
The supported range is:
Range | Value (secs) |
---|---|
Minimum | 1 |
Maximum | 60 |
Default value: 5 seconds
The KMXF_DEVICE_IRIGB_DRIFT_MAX
attribute specifies the maximum drift allowed from the IRIG-B source after which the IRIG-B decoder will fall to unlock state. The value is expressed according to the timebase resolution.
The supported range is:
Range | Value (ns) |
---|---|
Minimum | 1000 |
Maximum | 999000 |
Default value: 25000 ns