MX Foundation 4
Acquisition Service

The Acquisition Receive service provides the functions to sequentially buffer all the received data on one or several channels. Each receiver channel has an acquisition queue built in the device. The device onboard’s processor stores all the data as they are received with precise time stamping correlated with all channels. A function call is provided for the host application to read from a receiver acquisition queue.

A sequence of detected signal state(s) can be buffered in acquisition mode for reading. Each state is contained in a MXF_DISCRETE_DATAREC and typically contains the time tag defining when the state change was triggered.

When the acquisition is started on an RX channel, one record is immediately returned giving the initial state of the discrete input lines.

The edge field of the record will be set to 0. This means that no transition has been detected in the initial state. After, the records will be returned only if a change in at least one of the discrete input lines is detected based on KMXF_DISCRETE_RX_EDGE_FALLING and KMXF_DISCRETE_RX_EDGE_RISING attributes.

Example

The example below shows how to start an acquisition on discrete input channel.

discrete_event_handler.c

HMXF_CHANNEL rx;
HMXF_BUFFER bufferRx;
uint64 status;
uint64 msg, msgCount, byteCount;
uint32 rc=MAXT_SUCCESS;
...
// Allocate buffer for rx data
if(!rc)
{
// Device allocation
rc = mxfRxAcqBufferAlloc(rx, sizeof(dioRec), &bufferRx, NULL);
}
// Start acquisition
if(!rc)
rc = mxfRxAcqStart(bufferRx, MXF_RXACQ_FLAG_DEFAULT, 0, 0);
if (!rc)
{
// Wait 5 secs
mxfSleep(5000);
// Stop acquisition
if(!rc)
rc = mxfRxAcqStop(bufferRx);
// Read and display the records
rc = mxfDiscreteRxAcqRead(bufferRx, 0, sizeof(dioRec), &status, &msgCount, &byteCount, dioRec);
rxRec = dioRec;
for(msg=0; msg<msgCount && !rc; msg++)
{
printf("%llu: 0x%04x 0x%04x\n\r", rxRec->timeTag, rxRec->data, rxRec->edge);
rc = mxfDiscreteNextDataRecordPtrGet(rxRec, &rxRec);
}
}
...
Updated 10/23/2023