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 mxfCSDBRxAcqRead() function.

The MXF_CSDB_DATAREC structure must be used for reading a CSDB message with acquisition service.

Example

csdb_periodic.c

#define BUFFER_SIZE 4096
HMXF_CHANNEL rxChannel;
HMXF_BUFFER rxBuffer;
MXF_CSDB_DATAREC *rec=NULL;
uint32 rc;
MXF_CSDB_DATAREC* recPtr=rec;
uint64 status, msgsCount, bytesCount;
uint64 i, j;
...
// Allocate RX acquisition buffer
if (!rc)
rc = mxfRxAcqBufferAlloc(rxChannel, BUFFER_SIZE, &rxBuffer, NULL);
// Allocate host buffer
if (!rc)
{
rec = (MXF_CSDB_DATAREC*)malloc(BUFFER_SIZE);
if (!rec)
rc = MAXT_ERROR_MEM;
}
// Start the acquisition process
if (!rc)
rc = mxfRxAcqModeSet(rxBuffer, MXF_RXACQ_MODE_LINEAR);
if (!rc)
{
rc = mxfRxAcqStart(rxBuffer, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
if (!rc)
printf("\nAcquisition started\n\r");
}
...
// Reads and displays records
rc = mxfCSDBRxAcqRead(rxBuffer, 0, BUFFER_SIZE, &status, &msgsCount, &bytesCount, rec);
for (j=0; j<msgsCount && !rc; j++)
{
printf("%02llu: Timetag=%016llu: CSDB data=[ ", j, recPtr->timeTag);
for (i=0; i<BLOCKCOUNT; i++)
printf("0x%02X ", recPtr->data[i]);
printf("]\n\r");
mxfCSDBNextDataRecordPtrGet(recPtr, &recPtr);
}
...
Updated 10/23/2023