MX Foundation 4
Acquisition with Trigger

A basic acquisition program allows capturing all data received on a bus. In some cases, it is necessary to start capturing the traffic only when a specific event is detected. In this case, the acquisition triggering service can be used. Two types of events are supported: trigger on a specific CAN data word content and trigger on the running state of another channel.

When an acquisition with trigger is started, the received data is not available to the application until the trigger condition(s) is(are) met. In this state, the data received is kept in a circular queue. The maximum number of data records to be kept in the queue is configurable. If the queue is full, the older data are flushed to make place for newly incoming data. When the trigger conditions are realized, the acquisition goes into running state. In this state, the pre-trig data and all newly incoming data are queued until the application reads them (through the mxfCanBusRxAcqRead() function).
Trigger conditions can either be "ANDed" or "ORed" together.

When triggering on data word content, MXF_RXACQ_TRIG_COND_RDATA_DW_PARM.offset field has special meaning in CAN.

Offset 0 refers to the ID field (MXF_CANBUS_DATAREC.id). Useful to trigger on a specific CAN ID.
Offset 1 refers to the Info field (MXF_CANBUS_DATAREC.info). Useful to trigger on a specific DLC.
Offset 2 and following refer to the data field (MXF_CANBUS_DATAREC.data). The offset used in the data field is this offset-2. Note that this offset is in 32-bit (DWORD), but the data field is in 8-bit (BYTE).

Updated 10/23/2023