MX Foundation 4
MXF_CANBUS_SAMPREC Struct Reference

CAN bus Receive (Sampling) Record. More...

#include <mxf_class_canbus.h>

Data Fields

uint64 timeTag
 
uint32 control
 
uint32 errorCount
 
*uint32 dataSize
 
uint32 id
 
uint32 info
 
uint8 data [72]
 

Detailed Description

This CAN bus record structure is needed when receiving (sampling).

Examples:
canbus_sampling.c.

Field Documentation

uint64 MXF_CANBUS_SAMPREC::timeTag

Specifies the time when the data record has been received by the device. It is an absolute time expressed on the time base set for the device. The time tag may also be disabled with the KMXF_CANBUS_RX_TIMETAG_ENABLE attribute.

Examples:
canbus_sampling.c.
uint32 MXF_CANBUS_SAMPREC::control

For receive operation, the control field defines the condition under which the related record data was received.

The control bits are defined as follow:

Bit Constant Meaning
MXF_CANBUS_RX_REC_CTRL_CRC_ERROR A CRC error was detected in the incoming frame
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT Mask that specifies where the error has been detected. Goes with MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ below.
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_SOF Error detected in segment SOF
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ID28_ID21 Error detected in segment ID[28-21]
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ID20_ID18 Error detected in segment ID[20-18]
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_SRTR Error detected in segment SRTR
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_IDE Error detected in segment IDE
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ID17_ID13 Error detected in segment ID[17-13]
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ID12_ID5 Error detected in segment ID[12-5]
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ID4_ID0 Error detected in segment ID[4-0]
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_RTR Error detected in segment RTR
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_RESERVED1 Error detected in segment Reserved1
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_RESERVED0 Error detected in segment Reserved0
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_LEN_CODE Error detected in segment DLC
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_DATA Error detected in segment Data
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_CRC_SEQ Error detected in segment CRC sequence
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_CRC_DEL Error detected in segment CRC delimiter
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ACK_SLOT Error detected in segment ACK slot
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ACK_DEL Error detected in segment ACK delimiter
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_EOF Error detected in segment EOF
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_INTER Error detected in segment intermission
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ACTIVE_ERR_FLAG Error detected in segment active error flag
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_PASSIVE_ERR_FLAG Error detected in segment passive error flag
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_TOLERATE_DOMINANT_BIT Error detected in segment tolerate dominant bits
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_ERR_DEL Error detected in segment error delimiter
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_OVERLOAD_FLAG Error detected in segment overload flag
MXF_CANBUS_RX_REC_CTRL_ERROR_SEGMENT_FD_CTRL Error detected in segment FD flag (FDF, BRS, ESI)
MXF_CANBUS_RX_REC_CTRL_ERROR_CODE Mask that specifies the type of error that has been detected. Goes with MXF_CANBUS_RX_REC_CTRL_ERROR_CODE_ below.
MXF_CANBUS_RX_REC_CTRL_ERROR_CODE_BIT Bit monitoring error type
MXF_CANBUS_RX_REC_CTRL_ERROR_CODE_FORM Form error type. Invalid value in fixed bit-field.
MXF_CANBUS_RX_REC_CTRL_ERROR_CODE_STUFF Bit-stuffing error type. Message contains a sequence of six or more equivalent bits.
MXF_CANBUS_RX_REC_CTRL_ERROR_CODE_OTHER Other error type. Other type of error than Bit, Form or Stuff error.
MXF_CANBUS_RX_REC_CTRL_ERROR_DIR Mask that specifies the direction. Goes with MXF_CANBUS_RX_REC_CTRL_ERROR_DIR_ below.
MXF_CANBUS_RX_REC_CTRL_ERROR_DIR_TX Direction TX
MXF_CANBUS_RX_REC_CTRL_ERROR_DIR_RX Direction RX
MXF_CANBUS_RX_REC_CTRL_ERROR_ID An ID error was detected in the incoming frame
MXF_CANBUS_RX_REC_CTRL_ERROR_DLC A DLC error was detected in the incoming frame
MXF_CANBUS_RX_REC_CTRL_ERROR_LEN A data length error was detected in the incoming frame

A control of zero indicates that no errors was found while receiving data.

uint32 rate; /**< Time between the reception of the last two records expressed in the resolution of the process time base (usec or nsec). The maximum is about 1 sec; 4000000 in nsec or 4000 seconds in usec. If time tag is disabled, the rate will always be set to 0.

Examples:
canbus_sampling.c.
uint32 MXF_CANBUS_SAMPREC::errorCount

The number of detected errors.

* uint32 MXF_CANBUS_SAMPREC::dataSize

Number of bytes received in data array. The number of bytes include the CRC following the data.

Examples:
canbus_sampling.c.
uint32 MXF_CANBUS_SAMPREC::id

Received ID from the transmitter.

uint32 MXF_CANBUS_SAMPREC::info

Receive bits values of the arbitration field of the CAN frame.

Bit Constant Bosch Meaning ISO Meaning
MXF_CANBUS_REC_INFO_DLC 4-bit LSB mask for received DLC
MXF_CANBUS_REC_INFO_EXTENDED Set to one if IDE bit is received recessive (Extended frame format) [CEFF and FEFF]
MXF_CANBUS_REC_INFO_RTR Set to one if RTR bit is received recessive (RTR Frame) [CBFF and CEFF]
MXF_CANBUS_REC_INFO_R0 Set to one if r0 bit is received recessive Set to one if r0 bit is received recessive [CBFF and CEFF] or if res bit is received recessive [FDFF and FEFF]
MXF_CANBUS_REC_INFO_R1 Set to one if r1 bit is received recessive [CEFF, FBFF and FEFF] Set to one if RRS bit is received recessive [FBFF and FEFF] or if r1 bit is received recessive [CEFF]
MXF_CANBUS_REC_INFO_FD Set to one if EDL bit is received recessive [FBFF and FEFF] Set to one if FDF bit is received recessive (FD frame format) [FBFF and FEFF]
MXF_CANBUS_REC_INFO_FD_BRS Set to one if BRS bit is received recessive [FBFF and FEFF]
MXF_CANBUS_REC_INFO_FD_ESI Set to one if ESI bit is received recessive (error passive) [FBFF and FEFF]
MXF_CANBUS_REC_INFO_SRR_DOM Set to one if SRR bit is received dominant [CEFF and FEFF]
uint8 MXF_CANBUS_SAMPREC::data[72]

Acquisition mode: Data received + CRC.

Examples:
canbus_sampling.c.
Updated 10/23/2023