canmatrix icon indicating copy to clipboard operation
canmatrix copied to clipboard

DBC <=> XLSX initial_value

Open nexulm opened this issue 1 year ago • 4 comments

InitValue is transmitted to .xslx by converting .dbc to .xlsx with parameter: --additionalSignalAttributes initial_value

How can I get the InitialValue back from the generated .xlsx row "signal.initial_value" back to the dbc?

So far, it seems for me that this functionality isn't integrated in the code?

nexulm avatar Apr 11 '24 11:04 nexulm

Hi @nexulm

it is implemented, but maybe it does not work. Have to have a look on it

ebroecker avatar Apr 11 '24 13:04 ebroecker

Hy @nexulm - in deed - it was not implemented while switching to openpyxl, but should work just now

ebroecker avatar Jun 20 '24 12:06 ebroecker

It seems that the existing additional column "signal.initial_value" of the xlsx source file isn't used. Initial_value is always "0", only a few inital_value which are depending on the offset are showing another value than "0". But in this cases the offset calculation is the seems to be the reason to have the same value (initial_value = offset). For all signals the converted dbc shows initial_value = offset although the xlsx source has different values in the corresponding columns (signal.iniital_value and signal.offset) The script is called with these parameters:

python3 -m canmatrix.cli.convert --dbcImportEncoding=utf-8 \ --dbcImportCommentEncoding=utf-8 \ --dbcExportEncoding=utf-8 \ --dbcExportCommentEncoding=utf-8 \ --additionalSignalAttributes is_signed,factor,offset,min,max,initial_value,GenSigStartValue \ --additionalFrameAttributes size,DiagRequest,DiagResponse,ApplMessage,NmAsrMessage,GenMsgSendType \ "$path/$param_file_wo_extension.xlsx" "$path/$param_file_wo_extension.dbc"

nexulm avatar Jun 21 '24 07:06 nexulm

Hi @nexulm

could be fixed in branch: https://github.com/ebroecker/canmatrix/tree/issue_781

Additional: You don't need '--additionalSignalAttributes ... --additionalFrameAttributes ...' while importing xlsx files, they are only needed for export.

ebroecker avatar Jun 27 '24 12:06 ebroecker

should be merged

ebroecker avatar Jul 18 '24 09:07 ebroecker