• Home • Files • Structures         • Download

CpCanMsg_s Struct Reference

CAN message structure. More...


Data Fields

union {
   _U16   uwStd
   _U32   ulExt
tuMsgId
union {
   _U08   aubByte [8]
   _U16   auwWord [4]
   _U32   aulLong [2]
tuMsgData
_U08 ubMsgDLC
_U08 ubMsgCtrl
_TsCpTime tsMsgTime
_U32 ulMsgUser


Detailed Description

For transmission and reception of CAN messages a structure which holds all necessary informations is used. The structure has the following data fields:

Field Documentation

byte access, array of 8 byte

32 bit access, array of 2 longs

16 bit access, array of 4 words

The time stamp field defines the time when a CAN message was received by the CAN controller. This is an optional field (available if CP_CAN_MSG_TIME is set to 1).

union { ... } CpCanMsg_s::tuMsgData

The data field has up to 8 bytes (64 bit) of message data. The number of used bytes is described via the structure member ubMsgDLC.

union { ... } CpCanMsg_s::tuMsgId

The identifier field may have 11 bits for standard frames (CAN specification 2.0A) or 29 bits for extended frames (CAN specification 2.0B). The three most significant bits are reserved (always read 0).

See also:
Mask values for CAN messages

The structure member ubMsgCtrl defines the different data frames (2.0A / 2.0B) and the RTR frames.

  • Bit 0: Extended Frame if set to 1, else Standard Frame
  • Bit 1: Remote Frame if set to 1, else Data Frame
  • Bit 2: Receiver Overrun if set to 1, else normal reception
See also:
Mask values for CAN messages

The data length code denotes the number of data bytes which are transmitted by a message. The possible value range for the data length code is from 0 to 8 (bytes).

identifier for Extended Frame

The field user data can hold a 32 bit value, which is defined by the user. This is an optional field (available if CP_CAN_MSG_USER is set to 1).

identifier for Standard Frame


The documentation for this struct was generated from the following file:


 

© MicroControl GmbH & Co. KG

CANpie - V2.00