MX Foundation 4
Basic Acquisition

The way to set a basic acquisition receive application is as follows:

  • A receive channel must be obtained using the mxfModuleChannelGet() function or with the mxfModuleChannelAllGet() function by specifying the MXF_SCLASS_RXACQ_SRV subclass.
  • The acquisition buffer must be allocated using the mxfRxAcqBufferAlloc() function.
  • The acquisition mode can be set using the mxfRxAcqModeSet() function.

    Two modes of acquisition are defined:

    Condition Description
    MXF_RXACQ_MODE_LINEAR In this mode the acquisition stops when the buffer is full.
    MXF_RXACQ_MODE_CIRCULAR In this mode the acquisition buffer is circular and never stops receiving.
    Whenever the acquisition queue becomes full, the acquisition process will discard the newest received record.
  • The acquisition must be started using the mxfRxAcqStart() function.
  • A read loop can be implemented using the mxfA717RxAcqRead() function. The mxfA717NextDataRecordPtrGet() function needs to be used to navigate in the receive buffer.

The MXF_A717_DATAREC structure must be used to read ARINC 717 messages with acquisition service.

Example

The example below shows how to implement an ARINC 717 basic receive acquisition application.

ar717.c

#define MAX_TX_SUBFRAMES_TO_TRANSMIT 4
uint32 rc;
HMXF_CHANNEL rxChannel;
size_t rxBufferSize;
HMXF_BUFFER rxBuffer;
MXF_A717_DATAREC* rxHostBuffer;
uint64 rxAcqStatus;
uint64 msgCount;
uint64 byteCount;
uint64 data;
uint64 word;
...
// Allocates buffer for rx data
if(!rc)
{
rxBufferSize = MAX_TX_SUBFRAMES_TO_TRANSMIT*sizeof(MXF_A717_DATAREC);
// Allocates RX acquisition static buffer
rc=mxfRxAcqBufferAlloc(rxChannel, rxBufferSize, &rxBuffer, NULL);
// Host buffer allocation
if(!rc)
{
rxHostBuffer = (MXF_A717_DATAREC*) calloc(1, rxBufferSize);
if(!rxHostBuffer)
rc = MAXT_ERROR_MEM;
}
}
// Starts acquisition
if(!rc)
rc = mxfRxAcqStart(rxBuffer, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
...
if(!rc)
{
printf("Receiving ...\n");
// Reads rx buffer
rc = mxfA717RxAcqRead(rxBuffer, 0, rxBufferSize, &rxAcqStatus, &msgCount, &byteCount, rxHostBuffer);
}
if(!rc)
printf("String received count = %llu \n", msgCount);
if(!rc)
{
// Displays received strings
rec = rxHostBuffer;
for(data=0; data<msgCount && !rc; data++)
{
printf("%02llu: Timetag=%012llu, Size=%u words\n", data, rec->timeTag, (rec->dataSize)/2);
for(word=0; word < subframeSize; word++)
printf("%03X ", rec->data[word]);
printf("\n");
}
}
// Stops acquisition
if(!rc)
rc = mxfRxAcqStop(rxBuffer);
...
Updated 10/23/2023