MX Foundation 4
Errors Detection

The control field of the MXF_HFCE_DATAREC is used to detect errors on the received record. Many errors can detected on the receive record, such as : length error, FCS error and decoding error.

The example below shows how a program can receive HFCE words and detect received errors.

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

The received errors can be detected at two levels:

  • The first, is to use the datarec control field.
  • The second, is to check for queue detected errors by using the status parameters of the function. Typical errors of this type are reception queue overflow, because the data was not read fast enough.
{
HMXF_BUFFER rxBuffer;
uint64 status, msgCount, byteCount;
uint64 i;
...
// Reads the acquisition data
rc = mxfHFCERxAcqRead(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
hfceRec = (MXF_HFCE_DATAREC*)rec;
for(i=0; i < msgCount; i++)
{
if(hfceRec->control & MXF_HFCE_RX_REC_CTRL_LENGTH_ERROR)
printf("Hfce record #%d -> length error \n", i);
if(hfceRec->control & MXF_HFCE_RX_REC_CTRL_FCS_ERROR)
printf("Hfce record #%d -> FCS error \n", i);
mxfHFCENextDataRecordPtrGet(hfceRec, &hfceRec);
}
}
...
}
Updated 10/23/2023