Skip to content

Instantly share code, notes, and snippets.

@nberlette
Last active May 26, 2021 07:22
Show Gist options
  • Save nberlette/39ece85ed2115eb5ecc856cac6014120 to your computer and use it in GitHub Desktop.
Save nberlette/39ece85ed2115eb5ecc856cac6014120 to your computer and use it in GitHub Desktop.
DBC Specification for automotive/industrial CAN networks. Lifted from CANpy repo.

DBC Specification

Format description

<...> Required field
<A|B> A or B required
[...] Optional field
[A|B] A or B optional

Supported Keywords

Version

VERSION "<Number>"

Bus Speed

BS_: [speed-kbit/s]

Board Units

BU_: Node1 Node2 Node3 Node4

List of all Board Units (Nodes) in the Network. Also known as NetworkNodes, ECUs, Transmitters/Receivers, Producers/Consumers, SendingNodes/ReceivingNodes, etc.

Messages

BO_ <CAN-ID> <MessageName>: <MessageLength> <SendingNode>
  • CAN-ID in decimal (not hex), must be unique and not repeated in the document.
  • MessageLength in bytes.

Signals

SG_ <name> : <Start>|<Length>@<ByteOrder><+|-> (<factor>,<offset>) [<min>|<max>] "[unit]" [Rx]
  • min,max: proportional to factor, eg: a 16-bit max 65535 becomes 655.35 with .01 offset
  • Length: in bits.
  • Signed: + = unsigned; - = signed
  • ByteOrder (endianness): 1 = little-endian, Intel; 0 = big-endian, Motorola

Multiplexed Signals

SG_ <name> [M|m<M-ID>] : <Start>|<Length>@<ByteOrder><+|-> (<factor>,<offset>) [<min>|<max>] "[unit]" [Rx]
  • M: If M than this signals contains a multiplexer identifier.
  • M-ID: Signal definition is only used if the value of the multiplexer signal equals to this value.

Comments

CM_ [BU_|BO_|SG_] [Node|CAN-ID] [SignalName] "<Comments>";

CM_  "<Comments>" ;

CM_ BU_  <NodeId> "<Comments>" ;

CM_ BO_  <CAN-ID> "<Comment>" ;

CM_ SG_  <CAN-ID> <SignalName> "<Comment>" ;

Signal Values

VAL_ <CAN-ID> <SignalsName> <Name|Definition> ;

VAL_TABLE_ <Name> <Definition> ;

List of IntValue "StringValue" pairs, separated by whitespaces

Message Attributes

VFrameFormat

BA_DEF_ BO_  "VFrameFormat" ENUM  "StandardCAN","ExtendedCAN","StandardFD","ExtendedFD","J1939PG" ;

GenMsgSendType

BA_DEF_ BO_  "GenMsgSendType" ENUM "cyclic","triggered","cyclicIfActive","none" ;

Supported types:

  • cyclic
  • triggered
  • cyclicIfActive
  • cyclicAndTriggered
  • cyclicIfActiveAndTriggered
  • none
Default: none
BA_DEF_DEF_ "GenMsgSendType" "none" ;

GenMsgCycleTime

BA_DEF_ BO_  "GenMsgCycleTime" INT <mininum=0> <maximum=10000> ;

Message Cycle Time intervals defined in milliseconds.

Default: 0
BA_DEF_DEF_  "GenMsgCycleTime" 0 ;

GenMsgStartDelayTime

BA_DEF_ BO_  "GenMsgStartDelayTime" INT <mininum=0> <maximum=10000> ;

Time (ms) from startup to delay before sending the first message frame.

Default: 0
BA_DEF_DEF_  "GenMsgStartDelayTime" 0 ;

GenMsgDelayTime

BA_DEF_ BO_  "GenMsgDelayTime" INT <mininum=0> <maximum=10000> ;
Default: 0
BA_DEF_DEF_  "GenMsgDelayTime" 0 ;

Signal Attributes

SigType

BA_DEF_ SG_ "SigType" ENUM "Default","Range","RangeSigned","ASCII","Discrete","Control","DTC" ;

GenSigSendType

BA_DEF_ SG_  "GenSigSendType" ENUM "Cyclic","OnWrite","OnChange","NoSigSendType" ;

GenSigILSupport

BA_DEF_ SG_ "GenSigILSupport" ENUM "Yes","No" ;
Default: Yes

GenSigCycleTime

BA_DEF_ SG_ "GenSigCycleTime" INT <minimum=0> <maximum=0> ;
Default: 0

GenSigDelayTime

BA_DEF_ SG_ "GenSigDelayTime" INT <minimum=0> <maximum=0> ;
Default: 0

GenSigStartDelayTime

BA_DEF_ SG_ "GenSigStartDelayTime" INT <minimum=0> <maximum=0> ;
Default: 0

GenSigStartValue

BA_DEF_ SG_  "GenSigStartValue" INT <mininum=0> <maximum=0> ;

Defines the value as long as no value is set/received for this signal.

Default: 0
BA_DEF_DEF_  "GenSigStartValue" 0 ;

More Information

Document Scope:

This document doesn't claim to specifiy the complete Vector DBC standard

Sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment