CAN message format: An overview

22 Jul 2024
Ixxat
CAN message format: An overview
The four CAN message formats – data frame, remote frame, error frame, and overload frame – ensure efficient data transmission, request handling, error detection, and overload management in CAN networks.

Controller Area Network (CAN) distinguishes between several message formats for data transmission and signaling states. In this blog post, we would like to provide an overview of the different CAN message formats, their purpose, and structure.

A distinction is made between the following four CAN message formats for CAN: data frame, remote frame, error frame, and overload frame.

 

Data frame

The data frame is the most frequently used CAN message format in the CAN network. It is used to transmit usage data from a producer to one or more consumers. A typical data frame consists of several fields: 

  • Start of frame (SOF), a dominant bit
  • Arbitration field, consisting of the identifier and an RTR bit (remote transmission request)
  • Control field, which consists of the IDE bit (dominant for standard 11-bit identifier), a reserved bit, and the data length code
  • Data field 
  • Cyclic redundancy check (CRC) 
  • Acknowledgment slot (ACK)
  • End of frame (all bits recessive)

 

The arbitration field determines the priority of the CAN message, where lower values mean a higher priority. The data field may contain between 0 and 8 bytes of data, which allows for a flexible data transmission.

 

CAN message format: Classic 11-bit CAN Identifier

 

According to the valid classic CAN specification, two different compatible CAN message formats are defined, the “standard format” with an 11-bit identifier, as well as the “extended format” with a 29-bit identifier. 

 

The 29-bit identifier format

Use in commercial vehicles has shown that the large number of messages to be mapped requires a much longer identifier. That is why, in addition to the 11-bit identifier, an additionally extended format was defined with a 29-bit identifier. Based on the 29-bit identifier, up to 512 million messages can be distinguished. 

The standard and extended format are compatible with each other, which means that messages of both formats may exist in the same network. The two CAN message formats are distinguished by using the identifier extension bit (IDE bit). In the extended format, the 29-bit identifier is divided into two parts, namely the 11-bit long base identifier (base ID) and an 18-bit long extended identifier (extended ID). 

 

CAN message format: Extended 29-bit CAN Identifier

 

Remote frame

Each node can use a remote frame to request a certain message be sent for another node responsible for this message. The requested message is specified by the identifier transmitted with the remote frame. While it is possible to request a certain message from all receiving nodes, there may only be a single responsible sending node for the requested message.

The CAN message format of a remote frame corresponds to that of the data frame, with the difference that the RTR bit is transmitted recessively for a remote frame, while it is transmitted dominantly for a data frame. A remote frame arbitrated simultaneously with a data frame with the same identifier thus loses the arbitration, since the requested message has already been sent. In addition, the data field is empty. The data length code in the remote frame must correspond to that of the corresponding data frame.

 

Error frame

Each network node that detects an error while sending or receiving a data frame or remote frame immediately signals this to all other network nodes by sending an error frame. Since the error frame contains a bit sequence of six bits of the same polarity (error flag), this (intentionally) violates the bit stuffing rule*, thereby prompting the producer to resend the erroneously sent or received frame. 

The error frame consists of two fields. The first field results from a superimposition of error flags, connected by one or more network nodes. The second field, a sequence of 8 recessive bits, displays the end of the frame, similar to the data and remote frame.

*Bit stuffing with CAN is a process that ensures that the data transmission remains synchronous and error-free by automatically inserting an opposite bit following five of the same bits in succession. This prevents long sequences of the same bits disrupting the synchronization of network participants and facilitates error detection.

 

Error frame

 

Overload frame

The overload frame is used to indicate that a node is not ready to receive a message. This can occur due to internal delays or buffer overflows. The overload frame gives the node time to prepare to receive the next message. An overload frame can be considered a special error frame and, like it, consists of a flag (overload flag) and an end marker (overload delimiter). 

Unlike an error frame, sending an overload frame is dependent on very specific error conditions that relate to the intermission field and does not cause a repetition of a previously sent data or remote frame.

 

Summary

The four main types of CAN message formats – data frame, remote frame, error frame, and overload frame – are decisive for the functionality and reliability of CAN networks. Each CAN message format has its specific application areas and structures, which make it possible to efficiently transmit data, send requests, identify errors, and manage overload situations.