A DBC file is a database file that contains information about the communication of a single CAN (Controller Area Network) network. CAN is a serial bus system that is widely used in the automotive industry for connecting electronic control units (ECUs) and sensors. A DBC file defines the messages, signals, attributes and values that are exchanged on the CAN bus.
The DBC file format was developed by Vector Informatik GmbH in the 1990s and has become the most common format for storing CAN bus conversion rules[^2^]. However, it is not an official standard and there is no public documentation available for it. Therefore, different tools may interpret some aspects of the DBC file differently.
In this article, we will explain the basic structure and components of a DBC file, how to create and edit a DBC file using various tools, and how to use a DBC file for monitoring, analyzing and simulating CAN networks.
Structure and Components of a DBC File
A DBC file consists of several sections that start with a keyword followed by a colon. The main sections are:
VERSION: This section specifies the version of the DBC file format. It is usually a single line with a number.
NS_: This section defines the name spaces for attributes. Attributes are additional information that can be assigned to messages, signals or nodes. Name spaces are used to group attributes by their scope and type.
BS_: This section defines the bit timing parameters for the CAN bus. It is optional and usually omitted.
BU_: This section lists the nodes (ECUs) that participate in the CAN network. Each node has a unique name that is used to identify it in other sections.
BO_: This section defines the messages that are transmitted on the CAN bus. Each message has an identifier, a name, a length, a transmitter node and one or more signals.
SG_: This section defines the signals that are contained in each message. Each signal has a name, a start bit, a length, an endianness, a scaling factor, an offset, a minimum value, a maximum value, a unit and a receiver node or nodes.
EV_: This section defines the environment variables that are used to control or influence the behavior of nodes or messages. Each environment variable has a name, a type, a minimum value, a maximum value, an initial value, an access type and an access node or nodes.
CM_: This section contains comments that can be added to messages, signals or nodes. Each comment has a reference to the element it belongs to and a text.
VAL_: This section defines the value tables that map numeric values to descriptive texts for signals or environment variables. Each value table has a reference to the element it belongs to and a list of value-text pairs.
VAL_TABLE_: This section defines global value tables that can be shared by multiple signals or environment variables. Each global value table has a name and a list of value-text pairs.
BA_DEF_: This section defines attribute definitions that specify the name, type and default value of attributes.
BA_: This section assigns attribute values to messages, signals or nodes. Each attribute value has a reference to the attribute definition and the element it belongs to.
BA_DEF_DEF_: This section defines default attribute values for attribute definitions. It is optional and usually omitted.
SIG_VALTYPE_: This section defines the extended value types for signals that have more than one byte of length. It is optional and usually omitted.
How to Create and Edit a DBC File
A DBC file can be created and edited using various tools that support the DBC file format. Some of these tools are: