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 mxfA429RxAcqRead() function and the data received decoded using the mxfA429ArwDecompose() function.
The MXF_A429_DATAREC
structure must be used for reading an ARINC 429 message with acquisition service.
Example
ar429_periodic.c
The example below shows how to implement an ARINC 429 basic receive acquisition application.
#define BUFFER_SIZE 4096
HMXF_CHANNEL rxChannel;
HMXF_BUFFER rxBuffer;
uint64 status, msgsCount, bytesCount;
uint64 j;
uint32 label, sdi, data, ssm, parity;
uint32 rc;
...
if (!rc)
if (!rc)
{
if (!rec429)
rc = MAXT_ERROR_MEM;
}
if (!rc)
if (!rc)
{
if (!rc)
printf("\nAcquisition started\n\r");
}
...
rc =
mxfA429RxAcqRead(rxBuffer, 0, BUFFER_SIZE, &status, &msgsCount, &bytesCount, rec429);
for (j=0; j<msgsCount && !rc; j++)
{
if(!rc)
{
printf("%02llu: Timetag %llu - ARINC word=[%03llo,%lld,%05llX,%lld,%s]\n",
j, recPtr->
timeTag, label, sdi, data, ssm, (parity==VMXF_A429_PARITY_ODD)?
"ODD":
"EVEN");
if(!rc)
}
}
...