MX Foundation 4
Transmission with Record Relative Timing

Transmission with relative record timing means the records are scheduled one after another based on the delta time tag set.

The option MXF_TXAPERIODIC_FLAG_USE_RECORD_RELATIVE_TIME is used to perform this function.

For instance, for an array of n records to transmit, the records transmit timing is as follows:

Time record 1 = record 1 time tag (offset from current time)
Time record 2 = Time record 1 + (record 2 time tag - record 1 time tag)
Time record 3 = Time record 2 + (record 3 time tag - record 2 time tag)
......
Time record n = Time record n-1 + (record n time tag - record n-1 time tag)

Each time tag becomes relative to the previous record sent.

ar708_aperiodic.c

uint32 rc;
size_t txBufferSize;
HMXF_CHANNEL txChannel;
HMXF_BUFFER txBuffer;
MXF_A708_DATAREC * txHostBuffer;
uint32 delay100ms = 100000000;
uint64 currentTime;
uint64 data, word;
...
// Allocates 4 KB buffer for tx data
if(!rc)
{
txBufferSize = 4*1024;
// Allocates TX Aperiodic static buffer for HIGH priority queue
rc = mxfTxAperiodicBufferAlloc(txChannel, MXF_TXAPERIODIC_PRIORITY_HIGH, txBufferSize, &txBuffer, NULL);
// Host buffer allocation
if(!rc)
{
txHostBuffer = (MXF_A708_DATAREC*)calloc(1, txBufferSize);
if(!txHostBuffer)
rc = MAXT_ERROR_MEM;
}
}
...
rec=txHostBuffer;
// In the example below the timetag in the record is set
// and the option MXF_TXAPERIODIC_FLAG_USE_RECORD_RELATIVE_TIME.
// The relative time between each records is set in the
// timetag field of the record array.
printf("\nAperiodic transmission (Record Relative)\n");
// Set the record
// The scheduling timetag is as follow:
// clock current time + 100 ms
// Each record is sent with a timetag a 5000000 nsec (5 ms) interval.
if(!rc)
{
//Prepares records to send for basic transmission/reception test
for(data=0, currentTime=100000000; data<MAX_TX_RECORDS_TO_TRANSMIT; data++)
{
rec->timeTag = currentTime+(data*5000000);
rec->control = 0;
rec->repeatCount = 1;
rec->manchesterBitErr = 0;
rec->dataSize = 200; //200 bytes corresponds to 1600 bits (see ARINC 708 specification)
for(word=0; word < rec->dataSize/2; word++)
{
switch(word)
{
case 0:
rec->data[word] = 055; // Label 055
break;
case 1:
case 2:
case 3:
rec->data[word] = 0x0000;
break;
default:
rec->data[word] = (uint16)(0x0101*data);
}
}
rc = mxfA708NextDataRecordPtrGet(rec, &rec);
}
}
// Transmit the array of records
if(!rc)
{
printf("Transmitting ...\n");
rc = mxfA708TxAperiodicWrite(txBuffer, MXF_TXAPERIODIC_FLAG_USE_RECORD_RELATIVE_TIME, 0, MAX_TX_RECORDS_TO_TRANSMIT, txHostBuffer);
}
...
Updated 10/23/2023