Skip to content

reinzor/canmatrix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##Canmatrix is a python package to read and write several CAN database formats.##

###About

Canmatrix implements a "Python Can Matrix Object" which describes the can-communication and the needed objects (Boardunits, Frames, Signals, Values, ...) Canmatrix also includes two Tools (canconvert and cancompare) for converting and comparing CAN databases.

There is some outdated german Documentation and windows ".exe" of both scripts at my personal homepage There are several importers (read) and exporters (write) for this object.

supported file formats for import:

  • .dbc candb / Vector
  • .dbf Busmaster (open source!)
  • .kcd kayak (open source!)
  • .arxml autosar system description
  • .yaml dump of the python object
  • .xls(x) excel xls-import, works with .xls-file generated by this lib
  • .sym peak pcan can description

supported file formats for export:

  • .dbc
  • .dbf
  • .kcd
  • .xls(x)
  • .json Canard (open source!)
  • .arxml (very basic implementation)
  • yaml (dump of the python object)
  • sym

###Install instructions Install canmatrix with either "pip install canmatrix" or "python setup.py install"

This installs the canmatrix package into your python installation.

In addition to the canmatrix package there are 2 scripts installed with this package:

  1. canconvert:

    converts CAN database formats between all supported formats.

    Example: "canconvert someArSystemdescription.arxml file.dbc"

  2. cancompare:

    compares 2 CAN databases (of different or same format).

    Example: "cancompare file1.dbc file2.dbc"

If you are using a *NIX-System, these scripts should be callable from command line

If you are using a Windows system, these scripts are usually installed at the location of your python installation. For example 'C:\python3.4\Scripts' or 'C:\python2.7\Scripts'


###Dependencies

Canmatrix depends on:


###Examples

There are some example python scripts in the example-folder

examples/convert.py some-matrix.dbc some-matrix.dbf examples/convert.py some-matrix.arxml some-matrix.dbc


###Fileformats

  • all formats support im-/export of signals and frames

  • dbc:

    --dbcImportEncoding

                      Import charset of dbc (relevant for units), maybe
                      utf-8 default iso-8859-1
    

    --dbcImportCommentEncoding

                      Import charset of Comments in dbc default iso-8859-1
    

    --dbcExportEncoding

                      Export charset of dbc (relevant for units), maybe
                      utf-8 default iso-8859-1
    

    --dbcExportCommentEncoding

                      Export charset of comments in dbc default iso-8859-1
    

    --dbcCharset=CHARSET

                      set charset for dbc-file
    

    --dbcCommentCharset=CHARSET

                      set charset for comments in dbc-file 
    
  • dbf:

    --dbfImportEncoding

                      Import charset of dbf, maybe utf-8 default iso-8859-1
    

    --dbfExportEncoding

                      Export charset of dbf, maybe utf-8 default iso-8859-1
    
  • sym:

    --symImportEncoding

                      Import charset of sym format, maybe utf-8 default
                      iso-8859-1
    

    --symExportEncoding

                      Export charset of sym format, maybe utf-8 default
                      iso-8859-1
    
  • xls(x):

    --xlsMotorolaBitFormat

                      Excel format for startbit of motorola coded signals
                      Valid values: msb, lsb, msbreverse default msbreverse
    

more about starbits...

  • arxml:

    --arxmlIgnoreClusterInfo

                      Ignore any can cluster info from arxml; Import all
                      frames in one matrix default 0
    
  • yaml

  • json

  • kdc

  • csv

Export

Format ECUs Mux S/R of Signal Cycletype Cycletime Baudrate Extended Byteorder scaling min/max attributes value tables signal groups
arxml + + + +
dbc + + + + + + + + + + + +
dbf + + + + + + + + + + +
json +
kcd + + + + + +
sym + + + + + +
xls(x) + + + + + + + + +
csv + + + + + + + + * +

Import

Format ECUs Mux S/R of Signal Cycletype Cycletime Baudrate Extended Byteorder scaling min/max attributes value tables signal groups
arxml + + + + + + + + + + + +
dbc + + + + + + + + + + + +
dbf + + + + + + + + + + +
kcd + + + + +
sym + + + + + +
xls(x) + + + + + + p p p

Have Fun,

feel free to contact me for any suggestions

Eduard

About

Converting Can-Matrix-Formats .arxml .dbc .dbf .kcd ...

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%