canmatrix icon indicating copy to clipboard operation
canmatrix copied to clipboard

Convert dbc <=> xlsx - DLC is always reset to it's maximum of 8 bytes

Open nexulm opened this issue 1 year ago • 1 comments

During the conversion of dbc to xls and vice versa all CAN messages are resetted to max DLC of 8 bytes.

Input; Standard-CAN dbc

Command used with Ubuntu Linux 22.04: python3 -m canmatrix.cli.convert "$path/$param_file_wo_extension.dbc" "$path/$param_file_wo_extension.xlsx"

Is there any option I've missed to avoid resetting the current DLC length (i.e. DLC =3) to the max possible DLC bytes of 8? Since I'm using Canmatrix to convert the DBC, edit the entries in Excel and create an updated DBC from it, the observed behavior is not helpful.

nexulm avatar Feb 16 '24 17:02 nexulm

same here: xls(x) is lossy, but you can add additional Attributes: –additionalSignalAttributes//–additionalFrameAttributes

ebroecker avatar Feb 19 '24 13:02 ebroecker

Is it really closed if the code has a fixed value of dlc = 8 at line 409 of xlsx.py ??? image

I've fixed this specific issue in my fork by using frame.size as input. image

nexulm avatar Jun 19 '24 20:06 nexulm

Hi @nexulm,

you are right, the root-cause is different - all additional attributes are not read anymore since I switched to openpyxl. Will be fixed in #541 (which I just reopened)

ebroecker avatar Jun 20 '24 11:06 ebroecker