├── .gitignore ├── README.md ├── LICENSE └── docs ├── DBC_template.dbc └── DBC_Specification.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DBC Specification 2 | 3 | A overview of the [Vector DBC Specification can be found here](docs/DBC_Specification.md). 4 | * This doccument is carried together from different sources. 5 | * This document doesn't claim to be complete and correct. 6 | 7 | 8 | ## Status 9 | 10 | I am not actively working on this specification. 11 | But since there is some interest in the provided DBC Specification i will keep this repository. 12 | 13 | There is no progess on the original project idea [CANpy](#CANpy). 14 | 15 | ## Contribution 16 | 17 | I am happy to accept pull requests if someone wants to contributes changes to this specification. 18 | 19 | ## CANpy 20 | 21 | The original idea of this project was to provide a generic CAN interface 22 | generated from a *.dbc file. 23 | There is no intention to make any progess on this project and all sources are deleted. 24 | At commit [aae7b66](https://github.com/stefanhoelzl/CANpy/commit/aae7b66f1fd5d9606a189ca98a4b223656be7543) you can find the latests sources. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Stefan Hölzl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/DBC_template.dbc: -------------------------------------------------------------------------------- 1 | VERSION "1.0" 2 | 3 | 4 | NS_ : 5 | NS_DESC_ 6 | CM_ 7 | BA_DEF_ 8 | BA_ 9 | VAL_ 10 | CAT_DEF_ 11 | CAT_ 12 | FILTER 13 | BA_DEF_DEF_ 14 | EV_DATA_ 15 | ENVVAR_DATA_ 16 | SGTYPE_ 17 | SGTYPE_VAL_ 18 | BA_DEF_SGTYPE_ 19 | BA_SGTYPE_ 20 | SIG_TYPE_REF_ 21 | VAL_TABLE_ 22 | SIG_GROUP_ 23 | SIG_VALTYPE_ 24 | SIGTYPE_VALTYPE_ 25 | BO_TX_BU_ 26 | BA_DEF_REL_ 27 | BA_REL_ 28 | BA_DEF_DEF_REL_ 29 | BU_SG_REL_ 30 | BU_EV_REL_ 31 | BU_BO_REL_ 32 | SG_MUL_VAL_ 33 | 34 | BS_: 35 | 36 | BU_: Node2 Node1 Node0 37 | VAL_TABLE_ Value0 2 "Value2" 1 "Value1" 0 "Value0" ; 38 | VAL_TABLE_ Numbers 3 "Three" 2 "Two" 1 "One" 0 "Zero" ; 39 | 40 | 41 | BO_ 2147487969 CANMultiplexed: 2 Node0 42 | SG_ Value1 m1 : 8|8@1+ (1,0) [0|0] "" Node1 43 | SG_ Value0 m0 : 8|8@1+ (1,0) [0|0] "" Node0 44 | SG_ Multiplexer M : 0|8@1+ (1,0) [0|0] "" Node0 45 | 46 | BO_ 1234 CANMessage: 8 Node0 47 | SG_ Signal1 : 32|32@1+ (100,0) [0|100] "%" Node1,Node2 48 | SG_ Signal0 : 0|32@1- (1,0) [0|0] "" Node1,Node2 49 | 50 | 51 | 52 | EV_ UnrestrictedEnvVar: 0 [0|0] "Nm" 0 1 DUMMY_NODE_VECTOR8000 Node0; 53 | 54 | EV_ RWEnvVar_wData: 0 [0|1234] "" 60 2 DUMMY_NODE_VECTOR3 Node2; 55 | 56 | EV_ WriteOnlyEnvVar: 1 [0|1234] "" 60 3 DUMMY_NODE_VECTOR2 Node2; 57 | 58 | EV_ ReadOnlyEnvVar: 0 [0|100] "MPH" 20 4 DUMMY_NODE_VECTOR1 Node2; 59 | ENVVAR_DATA_ RWEnvVar_wData: 10; 60 | 61 | CM_ "DBC Template with single line description"; 62 | CM_ BU_ Node0 "The 0th Node"; 63 | CM_ BO_ 2147487969 "Multiplexed CAN-Message"; 64 | CM_ SG_ 1234 Signal0 "First signal in this message"; 65 | CM_ EV_ RWEnvVar_wData "This a comment for an environment variable"; 66 | CM_ EV_ WriteOnlyEnvVar "This a comment for an environment variable"; 67 | CM_ EV_ ReadOnlyEnvVar "This a comment for an environment variable"; 68 | 69 | BA_DEF_ EV_ "RWEnvVar_wData_Val" INT 0 10; 70 | BA_DEF_ EV_ "GlobalEnvVar_Val" HEX 256 320; 71 | BA_DEF_ SG_ "SGEnumAttribute" ENUM "Val0","Val1","Val2"; 72 | BA_DEF_ BU_ "BUIntAttribute" INT 0 100; 73 | BA_DEF_ BO_ "BOStringAttribute" STRING ; 74 | BA_DEF_ "FloatAttribute" FLOAT 0 50.5; 75 | BA_DEF_REL_ BU_EV_REL_ "ControlUnitEnvVarAttr" STRING ; 76 | BA_DEF_DEF_REL_ "ControlUnitEnvVarAttr" "MyVar"; 77 | BA_DEF_DEF_ "RWEnvVar_wData_Val" 5; 78 | BA_DEF_DEF_ "GlobalEnvVar_Val" 288; 79 | BA_DEF_DEF_ "SGEnumAttribute" "Val0"; 80 | BA_DEF_DEF_ "BUIntAttribute" 50; 81 | BA_DEF_DEF_ "BOStringAttribute" "String"; 82 | BA_DEF_DEF_ "FloatAttribute" 25.25; 83 | 84 | BA_ "FloatAttribute" 45.9; 85 | BA_ "BUIntAttribute" BU_ Node0 100; 86 | BA_ "BOStringAttribute" BO_ 1234 "MessageAttribute"; 87 | BA_ "SGEnumAttribute" SG_ 1234 Signal0 2; 88 | BA_ "RWEnvVar_wData_Val" EV_ RWEnvVar_wData 3; 89 | 90 | VAL_ 2147487969 Value1 3 "Three" 2 "Two" 1 "One" 0 "Zero" ; 91 | VAL_ 2147487969 Value0 2 "Value2" 1 "Value1" 0 "Value0" ; 92 | VAL_ RWEnvVar_wData 2 "Value2" 1 "Value1" 0 "Value0" ; 93 | VAL_ WriteOnlyEnvVar 2 "Value2" 1 "Value1" 0 "Value0" ; 94 | VAL_ ReadOnlyEnvVar 2 "Value2" 1 "Value1" 0 "Value0" ; -------------------------------------------------------------------------------- /docs/DBC_Specification.md: -------------------------------------------------------------------------------- 1 | # Scope 2 | This document doesn't claim to specifiy the complete [Vector DBC standard](http://vector.com/vi_candb_en.html) 3 | 4 | # Format description 5 | `<...>`: Required field 6 | `[...]`: Optional field 7 | ` | `: Or (eg. ) 8 | 9 | # Supported Keywords 10 | ## VERSION 11 | Version identifier of the DBC file. 12 | Format: `VERSION ""` 13 | 14 | ## NS_ 15 | Names used throughout the DBC file. 16 | Format:: 17 | ``` 18 | NS_: 19 | BS_ 20 | CM_ 21 | ... 22 | ``` 23 | 24 | 25 | ## BS_ 26 | Bus configuration. 27 | Format:: `BS_: ` 28 | Speed in kBit/s 29 | 30 | ## BU_ 31 | List of all CAN-Nodes, seperated by whitespaces. 32 | 33 | ## BO_ 34 | Message definition. 35 | Format: `BO_ : ` 36 | MessageLength in bytes. 37 | 38 | ## SG_ 39 | Signal definition. 40 | Format: `SG_ [M|m] : |@ (,) [|] "[Unit]" [ReceivingNodes]` 41 | Length in bits. 42 | Signed: + = unsigned; - = signed 43 | Endianness: 1 = little-endian, Intel; 0 = big-endian, Motorola 44 | M: If M than this signals contains a multiplexer identifier. 45 | MultiplexerIdentifier: Signal definition is only used if the value of the multiplexer signal equals to this value. 46 | 47 | ## CM_ 48 | Description field. 49 | Format: `CM_ [ [CAN-ID] [SignalName]] "";` 50 | 51 | ## BA_DEF_ 52 | Attribute definition. 53 | Format: `BA_DEF_ [BU_|BO_|SG_] "" [Config];` 54 | 55 | DataType | Description | Config format 56 | ---------|---------------------|---------------- 57 | INT | integer | ` ` 58 | FLOAT | floating point | ` ` 59 | STRING | string | 60 | ENUM | enumeration | `"",""...` 61 | 62 | ## BA_DEF_DEF_ 63 | Attribute default value 64 | Format: `BA_DEF_DEF_ "" ["]["];` 65 | 66 | ## BA_ 67 | Attribute 68 | Format: `BA_ "" [BU_|BO_|SG_] [Node|CAN-ID] [SignalName] ;` 69 | 70 | ## VAL_ 71 | Value definitions for signals. 72 | Format: `VAL_ ;` 73 | 74 | ## VAL_TABLE_ 75 | Value table definition for signals. 76 | Format: `VAL_TABLE_ ;` 77 | ValueTableDefinition: List of `IntValue "StringValue"` Pairs, seperated by whitespaces 78 | 79 | ## BO_TX_BU_: 80 | Transmitter for signals. 81 | Format: `BO_TX_BU_ : [BU_ seperated by commas]` 82 | 83 | ## SIG_GROUP_: 84 | Group signals assigned to one can-id. I guess it makes it easier to parse and assign the correct signals like this. 85 | Format: `SIG_GROUP_ : [Signal];` 86 | 87 | # Attributes 88 | In this sections are standard attributes used by [CANpy](https://github.com/stefanhoelzl/CANpy) defined. The attributes can be overwritten within a DBC file. 89 | ## Message Attributes 90 | 91 | ### GenMsgSendType 92 | Defines the send type of a message. 93 | Supported types: 94 | * cyclic 95 | * triggered 96 | * cyclicIfActive 97 | * cyclicAndTriggered 98 | * cyclicIfActiveAndTriggered 99 | * none 100 | Definition: `BA_DEF BO_ "GenMsgSendType" ENUM "cyclic","triggered","cyclicIfActive","cyclicAndTriggered","cyclicIfActiveAndTriggered","none"` 101 | Default: none 102 | Definition: `BA_DEF_DEF "GenMsgSendType" "none"` 103 | 104 | ### GenMsgCycleTime 105 | Defines the cycle time of a message in ms. 106 | Definition: `BA_DEF BO_ "GenMsgCycleTime" INT 0 0` 107 | Default: 0 108 | Definition: `BA_DEF_DEF "GenMsgCycleTime" 0` 109 | 110 | ### GenMsgStartDelayTime 111 | Defines the allowed delay after startup this message must occure the first time in ms. 112 | Definition: `BA_DEF BO_ "GenMsgStartDelayTime" INT 0 0` 113 | Default: 0 (=GenMsgCycleTime) 114 | Definition: `BA_DEF_DEF "GenMsgStartDelayTime" 0` 115 | 116 | ### GenMsgDelayTime 117 | Defines the allowed delay for a message in ms. 118 | Definition: `BA_DEF BO_ "GenMsgDelayTime" INT 0 0` 119 | Default: 0 120 | Definition: `BA_DEF_DEF "GenMsgDelayTime" 0` 121 | 122 | ## Signal Attributes 123 | ### GenSigStartValue 124 | Defines the value as long as no value is set/received for this signal. 125 | Definition: `BA_DEF SG_ "GenSigStartValue" INT 0 0` 126 | Default: 0 127 | Definition: `BA_DEF_DEF "GenSigStartValue" 0` 128 | 129 | # Sources 130 | http://pisnoop.s3.amazonaws.com/snoop_help_dbc.htm 131 | http://www.racelogic.co.uk/_downloads/vbox/Application_Notes/CAN%20Format%20for%20VBOXII%20and%20PRO%20v4.pdf 132 | https://hackage.haskell.org/package/ecu-0.0.8/src/src/j1939_utf8.dbc 133 | http://www.ingenieurbuerobecker.de/downloads/CANtool_Manual.pdf 134 | --------------------------------------------------------------------------------