MX Foundation 4
Error Detection

The control field of the MXF_A708_DATAREC and MXF_A708_SAMPREC is used to detect errors on the received record. Many different errors, like manchester or word length error, can be detected on a received record.

MXF_A708_SAMPREC has also an errorCount field that returns the number of errors detected for this sampling message.

Example

ar708_tx_error_injection.c
ar708_event_handler.c

The example below shows how a program can receive ARINC 708 words and detect receive errors.

The characters are read from the rx buffer and each record is check for data error.

The receive errors can be detected at two levels:

  • With the control field.
  • Further, we also check for buffer detected errors by using the status parameters of the function. Typical errors of this type are reception buffer overflow because the data was not read fast enough.
...
// Reads the acquisition data
rc = mxfA708RxAcqRead(rxBuffer, 0, sizeof(rec), &status, &msgCount, &byteCount, rec);
if(!rc)
{
if(status & MXF_RXACQ_STATUS_OVERFLOW)
printf("Acquisition Buffer overflow \n");
if(status & MXF_RXACQ_STATUS_BUFFER_FULL)
printf("Acquisition Buffer full \n");
if(status & MXF_RXACQ_STATUS_MODULE_PORT_OVERFLOW)
printf("Acquisition Module overflow \n");
if(status & MXF_RXACQ_STATUS_OUT_OF_RESOURCE)
printf("Acquisition out of resources \n");
// Checks error detected on a message basis
A708Rec = (MXF_A708_DATAREC*)rec;
for(i=0; i < msgCount; i++)
{
if(A708Rec->control & MXF_A708_RX_REC_CTRL_MANCHESTER_ERROR)
printf("ARINC 708 record #%d -> manchester error \n", i);
if(A708Rec->control & MXF_A708_RX_REC_CTRL_BITSCNT_ERROR)
printf("ARINC 708 record #%d -> bit count error \n", i);
if(A708Rec->control & MXF_A708_RX_REC_CTRL_TOOLONGWORD_ERROR)
printf("ARINC 708 record #%d -> message too long error \n", i);
if(A708Rec->control & MXF_A708_RX_REC_CTRL_BOWSYNC_ERROR)
printf("ARINC 708 record #%d -> Beginning sync error \n", i);
if(A708Rec->control & MXF_A708_RX_REC_CTRL_EOWSYNC_ERROR)
printf("ARINC 708 record #%d -> Ending sync error \n", i);
if(A708Rec->control & MXF_A708_RX_REC_CTRL_NOTENOUGHBITS_ERROR)
printf("ARINC 708 record #%d -> less than 200 bytes error \n", i);
if(A708Rec->control & MXF_A708_RX_REC_CTRL_TOOMANYBITS_ERROR)
printf("ARINC 708 record #%d -> more than 200 bytes error \n", i);
mxfA708NextDataRecordPtrGet(A708Rec, &A708Rec);
}
}
...
Updated 10/23/2023