Advanced DBC File Format Concepts
Saravana Pandian Annamalai
CEO @ Embien Technologies | Automotive | Embedded
The In-vehicle network communication leverages CAN network to transmit information from the ECUs in the automotive. The data representation of this information is captured via the DBC (DataBase container format). Our earlier article explored the inner workings of DBC files, from understanding the need for this format to delving into the details of messages, signals, and data representation with practical information. This article will cover some of the concepts such as keywords, attributes, and multiplexors along with a quick overview of popular editors and parsers. Let’s once again take a deep dive into the DBC files!?
Keywords in DBC file?
In a DBC file, various keywords are used to define and describe messages and signals. These keywords provide valuable information for interpreting and decoding the data in a DBC file.?
Version: This keyword indicates the version of the DBC file format being used. It helps ensure compatibility between different versions of DBC files. For example,??
VERSION "RELEASE_1_2"?
NS_: The "NS_" keyword is used to define the namespace for the messages and signals in a DBC file. It provides a way to organize and categorize the messages and signals.?
BO_: This keyword is used to define a message in a DBC file. It specifies the message identifier, attributes, and the associated signals.?
SG_: As seen earlier, this keyword is used to define a signal in a DBC file. It specifies the signal name, bit start position, bit size, data type, and other attributes.?
CM_: The CM_ keyword is used to add comments and annotations to the messages and signals in a DBC file. It provides additional information that can be useful for understanding the purpose and functionality of the messages and signals.?
BA: The “BA_” and "BA_DEF_" keywords are used to define attributes for messages and signals in a DBC file. It allows the definition of custom attributes and their values.?
For example,??
BA_ "ECUErrorState" BO_ 2000 1;??
Indicates that the ECUErrorState is conveyed via message with CAN ID 2000.?
BA_DEF_ BO_ “ ECUErrorState " ENUM? "No","Yes";?
Defines that ECUErrorState is a enumberated value with possible values Yes and No.?
BA_DEF_DEF_ “ ECUErrorState " "No";?
Indicates that the ECUErrorState’s default value is No.?
Message attributes in DBC file?
In addition to the keywords used to define messages and signals, DBC files also include attributes that provide further details about the messages. These attributes help in configuring the timing and behaviour of the messages in a DBC file.Typical attribute used in DBC files are:?
GenMsgSendType : This attribute specifies the transmission type of a message. It can be configured as cyclic, triggered, cyclicIfActive, cyclicAndTriggered, cyclicIfActiveAndTriggered, depending on the requirements of the system.?
GenMsgCycleTime : This attribute defines the time interval between consecutive transmissions of a periodic message in milli seconds. It ensures that the message is sent at regular intervals.?
GenMsgStartDelayTime :It specifies the delay before a periodic message starts transmitting. It allows synchronization of messages in a network.?
GenMsgDelayTime : Used to define the minimum time delay between consecutive transmissions of a condition-triggered message. It ensures that the message is not transmitted too frequently.?
领英推荐
Signal attributes in DBC file?
In addition to the attributes associated with messages, DBC files also include attributes that can be defined for individual signals. One such attribute is the "GenSigStartValue," which specifies the initial value of a signal when a message is transmitted.The same value is used in the receiver as default value until the signal is received.?
The "GenSigStartValue" attribute is useful in scenarios where the initial value of a signal is important for system initialization or calibration. It ensures that the signal has a predefined value when the system starts up.?
Multiplexed message in DBC file?
In some cases, when there is a lot of information to be sent, it would be better to leverage the same CAN ID instead of allocating one for each. For example, take a case of some 100 sensors available in an ECU. Rather than allocating separate messages, it can leverage the concept of multiplexed messages.??
A multiplexed message is a message that can have different signals depending on the value of a multiplexer signal. The multiplexer signal acts as a selector, determining which signals are transmitted within the message. To create a multiplexed signal, the M keyword is used in the signal, whose value will determine how the rest of the signals are to be decoded. With keyword m0, m1 and so on, other signals are written representing the value of the selection signal.??
Take the case of below DBC file.?
Here the SensorSelect signal is used as selector i.e. to determine how the other signals can be decoded. If it is 0, 16-bits starting from position 24, Sensor1Value’s value is available. If it is 1, 16-bits starting from position 24, Sensor2Value’s value is available. Thus, the single message can be used to represent up to values from 100 sensors.?
It can be noted that the SensorTime signal is un-multiplexed, and it is available in all the messages irrespective of the selector value. The visual representation of this is as follow:?
It is possible to go for extended multiplexing where a multiplexed signal can be used as a selector for another set of multiplexed signals.??
Thus, multiplexed messages can be used in automotive systems to optimize the usage of bandwidth and reduce the number of messages transmitted. They allow multiple signals to be packed into a single message, reducing the overall data size, and improving the efficiency of communication.?
DBC editors?
Though technically the DBC files can be created/edited with simple text editors, larger DBC files can be complex and require specialized tools for editing and manipulating their contents. DBC editors are software applications that provide a user-friendly interface for working with DBC files. They allow engineers to create, modify, and validate DBC files without the need for manual editing.?
Some of the popular DBC editors include Vector CANDB++, Kvaser Database editor, CSS Online editor, etc.?
DBC editors offer features such as syntax highlighting, auto-completion, and error checking, which help in creating accurate and error-free DBC files. They also provide visual representations of messages and signals, making it easier to understand and interpret the data structure.?
DBC parsers
DBC parsers are software libraries or modules that are used to interpret and decode the contents of a DBC file. They provide APIs (Application Programming Interfaces) that allow developers to read and extract information from DBC files programmatically.?
DBC parsers are essential for developing applications that need to interpret and process DBC files. They handle the complex parsing and decoding logic, freeing up developers to focus on the actual functionality of their applications.?
Embien’s Flint tool allows importing DBC files directly and can be used to receive signals from other ECU’s and also to transfer data to the in-vehicle network using the RAPIDSEA IVN stack.?
Conclusion?
In conclusion, DBC files play a crucial role in the development and testing of automotive systems. With a deep understanding of the data representation and some of the keywords in the DBC file, it will be helpful for the engineers to implement ECU functionalities as per the requirements. Look forward for more such articles covering such important formats, protocols, and tools with respect to the automotive industry here.??
To know more, visit - https://www.embien.com/automotive-insights/advanced-dbc-file-format-concepts