danielhrisca / asammdf

Fast Python reader and editor for ASAM MDF / MF4 (Measurement Data Format) files
GNU Lesser General Public License v3.0
633 stars 224 forks source link

J1939 DBC: Support vFrameFormat default value #927

Closed MatinF closed 11 months ago

MatinF commented 11 months ago

In the DBC file format, it is possible to define 'default' values for various attributes, incl. vFrameFormat. In the case of a J1939 DBC file, this can be used to specify that all messages are to be interpreted as J1939PG with a single line.

However, asammdf currently only looks at individual ID-by-ID vFrameFormat lines, ignoring the default value. As a result, setting only the default value of vFrameFormat to J1939PG implies that all IDs are treated as regular 29-bit extended IDs, instead of being interpreted via PGN decoding.

This would be nice to change to adhere to the DBC standard, but also to ensure that it's possible to create 'light' DBC files for faster decoding purposes.

danielhrisca commented 11 months ago

@MatinF please provide an example DBC

MatinF commented 11 months ago

See attached j1939-data.zip

danielhrisca commented 11 months ago

I've made changes to check the database attribute loaded by canmatrix https://github.com/danielhrisca/asammdf/blob/36dc7cd393112a53488438a2fd370ebf583c5ee8/src/asammdf/mdf.py#L4765

@ebroecker maybe it makes sense to perform this check when settings the is_j1939 attribute in canmtrix ?

MatinF commented 11 months ago

This is resolved in the latest development version, thanks Daniel - would be great with a 7.3.17 release as it resolves a lot of the outstanding issues :-)