Looking for a free program to write CAN bus DBC files - Page 1
Forum section: electronics / beginners

author: Simon
author_rank: Unknown
timestamp: December 18, 2017, 04:37:40 pm
content: I have my ID's and i know what byte is what but I need a DBC file to make sense of that. I'm sure there is a free program somewhere that helps with their creation?

author: Jeroen3
author_rank: Super Contributor
timestamp: December 18, 2017, 06:12:43 pm
content: I work with CAN bus a lot. But what are DBC files? I've seen it inBusmaster, but never used it.

author: Simon
author_rank: Unknown
timestamp: December 18, 2017, 06:15:28 pm
content: DBC files are the underlying database files that define messages and signal names, so you can put entries in for ID's and bytes in those ID's messages and name them as well as i think apply formatting.

author: voltsandjolts
author_rank: Unknown
timestamp: December 18, 2017, 07:07:18 pm
content: Is that a Vector (https://vector.com/vi_candb_en.html) proprietary format? Generated from CANdb++?

author: voltsandjolts
author_rank: Unknown
timestamp: December 18, 2017, 07:09:03 pm
content: Just a cross reference incase you need this for the next step:https://www.eevblog.com/forum/microcontrollers/vector-candb-to-cc-h-converter/

author: Simon
author_rank: Unknown
timestamp: December 18, 2017, 07:11:40 pm
content: Quote from: voltsandjolts on December 18, 2017, 07:09:03 pmUh I'm nowhere near that yet, just trying to write a simple DBC file to decode one message with 3 parameters in it. Reading and converting HEX is not the most ideal thing. I have found the Kvaser database editor, I think our design subcontractor uses it, he's in tomorrow so can give me a hand if all else fails.

author: SparkyFX
author_rank: Frequent Contributor
timestamp: December 19, 2017, 03:13:53 am
content: Header and definition of Namespaces used:Code:VERSION ""NS_ :BU_BO_CM_BO_TX_BU_Define the CAN Nodes like this:Code:BU_: $Node1 $Node2Define a CAN Frame like this:Code:BO_ $MessageID_decimal $FrameName: $DLC $SenderNameSG_ $SignalName : $SignalPos|$SignalLen@0$Signed ($Mult,$Offset) [$Range_from|$Range_to] "$Unit" $ReceiversOne line per signal. Separate Messages via empty newline.Where$DLC is number of bytes for this frame$SignalPos and $SignalLen is in bits, $SignalPos counted strangely reversed bitorder LSB(it)->MSB(it) (so "7|64" really means bits 0..63)$Signed is + or -$Receivers : comma separated list of nodes that will filter that signalIf a frame is by definition mapped to several mutually exclusive nodes (in reality it is a bad idea to have two nodes send the same ID) on a subnet, define it this way:Code:BO_TX_BU_ $MessageID_decimal : $Node1,$Node2;Comments for various elements defined before:Code:CM_ "Bus description";CM_ BU_ $SenderName "Sender description";CM_ SG_ $MessageID_decimal $SignalName "Signal description";That would be a minimal approach, but there is tons more in there to set key-value properties of signals and frames, i´ve got no idea if the format would be valid without it and load in tools that work with it.Anyway, it is usually not worth the trouble messing with those proprietary formats, just load the raw data into a spreadsheet and go from there.

author: SparkyFX
author_rank: Frequent Contributor
timestamp: December 19, 2017, 03:19:57 am
content: Editing the previous post would smash the formatting again, wanted to add this:The file itself should be- Windows line format, so CR+LF at line end- UTF8 without BOM should be OK.

author: JPortici
author_rank: Super Contributor
timestamp: December 19, 2017, 07:12:24 am
content: Quote from: Jeroen3 on December 18, 2017, 06:12:43 pmI've created a couple with bustmaster, handy when you have to apply conversion factors.. like for example when speed have to be shifted right by 7 bits to be human readableJust so you know, keysight scopes (X3000 and up) have both CAN and CAN-DBC mode decodes. how cool is that?

author: SparkyFX
author_rank: Frequent Contributor
timestamp: December 19, 2017, 12:53:17 pm
content: Doh! There is a wiki page describing the format here:http://www.socialledge.com/sjsu/index.php?title=DBC_Format