Fundamentals 8 min read

Decoding DBC Files: A Practical Guide to CAN Network Definitions

This article explains the structure and interpretation of Vector's DBC file format, covering nodes, messages, signals, byte order, scaling, and annotation syntax with concrete examples and code snippets.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Decoding DBC Files: A Practical Guide to CAN Network Definitions

What Is a DBC File?

DBC is a file format defined by Vector for describing CAN network communication. The official specification can be found in the "DBC File Format Document". Engineers typically open DBC files with the Vector CANdb++ Editor, which displays nodes, messages, and signals in a graphical layout.

Key Sections in the Editor

The Network nodes panel lists all transmitting and receiving nodes defined in the DBC. Expanding a node (e.g., NEO ) shows the messages it sends or receives. Each message shows the Node Name (sender), Message Name , ID (hexadecimal CAN identifier), DLC (data length in bytes), and Cycle Time (periodic transmission interval).

Within a message, the Signals table lists each signal’s name, start bit, length, byte order (Motorola or Intel), sign, factor, offset, minimum, maximum, and unit. The layout panel visualises how bits are packed in the CAN frame.

Signal Byte Order Details

Two byte‑order conventions are used:

Motorola (big‑endian): bits are numbered from the most‑significant bit of the start byte and count downwards.

Intel (little‑endian): bits are numbered from the least‑significant bit and count upwards.

When a signal fits within a single byte, both conventions place the most‑significant bit (MSB) at the high‑order position of that byte. For multi‑byte signals, Motorola places the MSB in the high‑order bit of the low‑order byte, while Intel places the MSB in the high‑order bit of the high‑order byte. In all cases, the start bit refers to the signal’s least‑significant bit.

Low‑Level DBC Syntax

A DBC file can be opened with any text editor. Example excerpt:

VERSION ''
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
...
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_

BS_:

BU_: K182_PACM K43_PSCM K17_EBCM NEO K124_ASCM

Important keywords: VERSION: DBC version string. NS_: Namespace definitions (auto‑generated, usually ignored). BS_: CAN bus baud rate definition (must be present, content optional). BU_: List of bus nodes.

Message definition example:

BO_ 823 PACMParkAssitCmd: 7 NEO
 SG_ RollingCounter : 35|2@0+ (1,0) [0|0] ''  NEO
 SG_ SteeringWheelChecksum : 47|16@0+ (1,0) [0|0] ''  NEO
 SG_ SteeringWheelCmd : 23|16@0+ (1,0) [0|0] ''  NEO

This defines a frame with ID 0x337 (823 decimal), name PACMParkAssitCmd , length 7 bytes, sent by node NEO , and containing three signals.

Signal definition syntax breakdown:

SG_ SignalName : startBit|length@byteOrder+/- (factor,offset) [min|max] "unit" sender

Example for a single signal:

// BO_ 1073 TRACK_1: 8 RADAR
 SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] 'm'  NEO

Interpretation:

Start at bit 7, length 12 bits.

@0 indicates Motorola byte order.

+ means unsigned.

Factor 0.0625, offset 0, range 0–255.5 m.

Receiver node is NEO .

Annotations and Value Tables

Comments ( CM_) add human‑readable notes to nodes, messages, or signals. Example:

CM_ SG_ 1024 RADAR_STATE 'need to find out more diagnostic values';

Value tables ( VAL_) map numeric values to textual meanings:

VAL_ 1024 RADAR_STATE 121 'ok' 110 'faulted' 105 'wrong_config';

This declares that signal RADAR_STATE (ID 0x400) equals 121 → “ok”, 110 → “faulted”, 105 → “wrong_config”.

Signal Groups

Signal groups bundle related signals:

SIG_GROUP_ 896 VehBattU 1 : VehBattUSysU VehBattUSysUQf;

Group VehBattU contains VehBattUSysU and VehBattUSysUQf .

Practical Takeaways

Understanding DBC syntax is essential for developing ECU software, diagnostic tools, or any application that needs to encode/decode CAN messages. By mapping the textual definitions to actual bit‑level layouts, engineers can correctly scale raw values, apply offsets, and interpret enumerated states.

embedded systemsautomotiveCANVehicle NetworksDBCSignal Encoding
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.