---
title: "Network databases (DBC and the CAN Database view)"
---

# Network databases (DBC and the CAN Database view)

Edit DBC files as a language and in the CAN Database view, with 22 checks, navigation and rename, every object CANdb++'s dialogs edit, the codec every view decodes with, and a semantic compare of two databases.

There is no project file of the module's own: your files are the project. A DBC and each CAN channel of an ARXML description become the same CAN database model, so decoding, traces, the bus monitor, simulation and the agent tools work the same on both. LDF and ARXML are on [LDF and ARXML](https://neuralinverse.com/docs/modules/automotive/ldf-and-arxml/); new databases, the communication matrix and generated C code on [Templates, exchange and C code](https://neuralinverse.com/docs/modules/automotive/database-exchange/).

## DBC as a language

Open a `.dbc`: it opens as text, in the DBC language.

- Colouring and an outline of nodes, messages with signals, value tables and environment variables.
- Hover a signal for its layout and bytes, byte order, value type, scaling, range, receivers, multiplexing, value names and comment; hover a message for its identifier, format, size, cycle time and senders.
- Go to definition, find references and rename. A signal rename changes its `SG_` and every `CM_`, `BA_`, `VAL_`, `SIG_VALTYPE_`, `SG_MUL_VAL_` and `SIG_GROUP_` use, and refuses names that are not C identifiers or are taken.
- 22 consistency checks in Problems as you type: identifier range and duplicates, classic and CAN FD payload sizes, signals outside the frame, signals that overlap while both can be in one frame (plain, cascaded and extended multiplexing), float lengths, zero factors, ranges the raw bits cannot reach, value descriptions the signal cannot carry, unknown transmitters and receivers, attribute values outside their definition, invalid and over-long names.
- **Check CAN Databases in Workspace** checks every database.

DBC files default to Windows-1252 with encoding guessing among the encodings CANdb++ and other DBC writers use (UTF-8, Windows-1252, Shift JIS, GB2312 and EUC-KR), so files saved by CANdb++ keep their accented characters. A file in another code page (Cyrillic, Greek, Central European) shows wrong letters until you reopen it with its encoding.

**State:** verified on vendor samples (Vector, Kvaser, CSS Electronics; at most 33 messages per file) against cantools.

## The CAN Database view

Run **Open CAN Database View** (editor title button), **Open CAN Database View to the Side**, or Reopen Editor With; **Show Database Source Text** goes back. The view follows unsaved edits of the text and writes nothing until you change something.

| Tab | What you can do |
|---|---|
| Messages | Filter and sort messages; edit every `BO_` and `SG_` field, comments and cycle time; a signal table with its problems, a signal form and a bit layout grid (bytes by bits 7 to 0, MSB and LSB marked, overlaps highlighted, multiplexed signals per multiplexor value); signal groups (add, rename, repetitions, signals, delete); Multiplexor, Multiplexed By and Multiplexor Values (`1, 3-5`) |
| Network | Nodes and the Tx/Rx communication matrix; **Choose Transmitted Messages...** (written in `BO_` and `BO_TX_BU_`), **Choose Received Signals...** |
| Value Tables | Add, rename, delete tables and edit their values; a signal's or environment variable's own `VAL_`; **Assign Value Table...** writes a table's values as the signal's own, as CANdb++ stores them, and the view names the tables whose values a signal has |
| Environment Variables | Type (Integer, Float, String, Data with its `ENVVAR_DATA_` size), range, unit, initial value, identifier, access, nodes, comment, value descriptions, attributes |
| Attributes | Definitions of every type (INT, HEX, FLOAT, STRING, ENUM) for the network, nodes, messages, signals, environment variables and the relations of nodes to messages, signals and environment variables (`BA_DEF_REL_`), with range, ENUM values and default; values of every object and relation (`BA_REL_`), checked against the definition, with the default shown where an object has no value |

![The Messages tab of the CAN Database view with the signal form of a multiplexed signal, its value descriptions and attributes.](https://neuralinverse.com/docs-images/modules/automotive/can-database-signal-form.webp)

**Add Message**, **Add Signal**, **Add Signal Group**, **Add Node**, **Add Value Table**, **Add Environment Variable** and **Add Attribute Definition**, and the matching Delete actions, cover every object kind.

- Every change is a minimal, undoable edit of the DBC text in CANdb++'s formatting, placed where CANdb++ puts it. Only the tokens or statements that change are written; line endings and the rest of the file stay as they were.
- A rename updates every reference. A node rename reaches transmitters, receivers, `BO_TX_BU_`, comments, attribute and relation values and environment variables.
- A delete removes every dependent statement. A deleted node's messages get `Vector__XXX` or their next transmitter, and it leaves receiver lists.
- Multiplexing that a plain `mN` cannot say is written as `SG_MUL_VAL_` for every multiplexed signal of the message.
- An attribute definition's new type converts its values; reordered or extended ENUM values keep their labels.
- The view refuses what the format or the database cannot hold (a name that is not a C identifier, a value outside its definition's range, a double quote in a value description or ENUM value) and says why.

![The Network tab of the CAN Database view with the nodes, their attributes and the Tx/Rx communication matrix.](https://neuralinverse.com/docs-images/modules/automotive/can-database-network.webp)

ARXML files open in the same view, read only: a channel selector when a description has several CAN channels, the AUTOSAR checks' problems on their messages and signals across every file of a split model, and reveal into the file and element each object comes from.

**State:** reading verified on vendor samples; writing modelled. Opening and saving without a change gives the same bytes on all 220 vendor and community files tested, and every edit reads back as the change in cantools and canmatrix. **No edited file has been opened in CANdb++**, so check your edited DBC in CANdb++ before relying on it.

## Compare databases

**Compare Selected CAN Databases** (two files selected in the Explorer), **Compare CAN Database With...** and **Compare CAN Database with HEAD** open a diff of added, removed and changed messages, signals, attributes, value descriptions and nodes, navigable to both files. Works for DBC files and CAN channels of ARXML.

**State:** modelled, on community DBC pairs against canmatrix; no pair of vendor files compared.

## The codec

Every view that decodes uses one codec: Intel and Motorola byte order, signed values, negative factors, IEEE float and double, signals up to 64 bits as exact raw values, CAN FD payloads up to 64 bytes, and plain, cascaded and extended multiplexing. Encoding picks multiplexor values that select the given signals, rounds to the nearest raw step (ties to even) and never clamps: a value that does not fit is reported and not written. AUTOSAR container PDUs with headers decode frame by frame from their headers (see [LDF and ARXML](https://neuralinverse.com/docs/modules/automotive/ldf-and-arxml/)).

**State:** verified on vendor samples against cantools (83 messages compared). The vendor samples have no float signal; floats are covered by community files only.
