Author Topic: Looking for a free program to write CAN bus DBC files  (Read 15308 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Looking for a free program to write CAN bus DBC files
« on: December 18, 2017, 04:37:40 pm »
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?
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Looking for a free program to write CAN bus DBC files
« Reply #1 on: December 18, 2017, 06:12:43 pm »
I work with CAN bus a lot. But what are DBC files? I've seen it in Busmaster, but never used it.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Looking for a free program to write CAN bus DBC files
« Reply #2 on: December 18, 2017, 06:15:28 pm »
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.
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2298
  • Country: gb
Re: Looking for a free program to write CAN bus DBC files
« Reply #3 on: December 18, 2017, 07:07:18 pm »
Is that a Vector (https://vector.com/vi_candb_en.html) proprietary format? Generated from CANdb++?
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2298
  • Country: gb
Re: Looking for a free program to write CAN bus DBC files
« Reply #4 on: December 18, 2017, 07:09:03 pm »
Just a cross reference incase you need this for the next step:
https://www.eevblog.com/forum/microcontrollers/vector-candb-to-cc-h-converter/
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Looking for a free program to write CAN bus DBC files
« Reply #5 on: December 18, 2017, 07:11:40 pm »
Just a cross reference incase you need this for the next step:
https://www.eevblog.com/forum/microcontrollers/vector-candb-to-cc-h-converter/

Uh 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.
 

Offline SparkyFX

  • Frequent Contributor
  • **
  • Posts: 676
  • Country: de
Re: Looking for a free program to write CAN bus DBC files
« Reply #6 on: December 19, 2017, 03:13:53 am »
Header and definition of Namespaces used:
Code: [Select]
VERSION ""

NS_ :
BU_
BO_
CM_
BO_TX_BU_



Define the CAN Nodes like this:
Code: [Select]
BU_: $Node1 $Node2

Define a CAN Frame like this:
Code: [Select]
BO_ $MessageID_decimal $FrameName: $DLC $SenderName
 SG_ $SignalName : $SignalPos|$SignalLen@0$Signed ($Mult,$Offset) [$Range_from|$Range_to] "$Unit" $Receivers

One 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 signal

If 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: [Select]
BO_TX_BU_ $MessageID_decimal : $Node1,$Node2;

Comments for various elements defined before:
Code: [Select]
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.
« Last Edit: December 19, 2017, 03:16:47 am by SparkyFX »
Support your local planet.
 

Offline SparkyFX

  • Frequent Contributor
  • **
  • Posts: 676
  • Country: de
Re: Looking for a free program to write CAN bus DBC files
« Reply #7 on: December 19, 2017, 03:19:57 am »
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.

Support your local planet.
 

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Looking for a free program to write CAN bus DBC files
« Reply #8 on: December 19, 2017, 07:12:24 am »
I work with CAN bus a lot. But what are DBC files? I've seen it in Busmaster, but never used it.

I'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 readable
Just so you know, keysight scopes (X3000 and up) have both CAN and CAN-DBC mode decodes. how cool is that :)?
 

Offline SparkyFX

  • Frequent Contributor
  • **
  • Posts: 676
  • Country: de
Re: Looking for a free program to write CAN bus DBC files
« Reply #9 on: December 19, 2017, 12:53:17 pm »
Doh! There is a wiki page describing the format here: http://www.socialledge.com/sjsu/index.php?title=DBC_Format
Support your local planet.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf