CANopen Slave Documentation
Version 6.16.04
|
For transmission and reception of CAN messages a structure which holds all necessary informations is used. The structure has the following data fields:
Data Fields | ||
uint32_t | ulIdentifier | |
uint8_t | ubMsgDLC | |
uint8_t | ubMsgCtrl | |
uint32_t | ulMsgUser | |
union { | ||
uint8_t aubByte [CP_DATA_SIZE] | ||
uint16_t auwWord [CP_DATA_SIZE/2] | ||
uint32_t aulLong [CP_DATA_SIZE/4] | ||
} | tuMsgData | |
uint8_t CpCanMsg_s::aubByte[CP_DATA_SIZE] |
byte access, array of bytes
uint32_t CpCanMsg_s::aulLong[CP_DATA_SIZE/4] |
32 bit access, array of longs
uint16_t CpCanMsg_s::auwWord[CP_DATA_SIZE/2] |
16 bit access, array of words
union { ... } CpCanMsg_s::tuMsgData |
The data field has up to 8 bytes (for classic CAN) or 64 bytes (for ISO CAN FD) of message data. The number of used bytes is described via the structure member ubMsgDLC
.
uint8_t CpCanMsg_s::ubMsgCtrl |
The structure member ubMsgCtrl
defines the different data frames (2.0A / 2.0B) and the RTR frames.
uint8_t CpCanMsg_s::ubMsgDLC |
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 for classic CAN and 0 to 15 for ISO CAN FD.
uint32_t CpCanMsg_s::ulIdentifier |
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).
uint32_t CpCanMsg_s::ulMsgUser |
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).