You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a dbc with state encodings as
VAL_ 272 Signal_1 16 "State A" 32 "State B" ;
VAL_ 272 Byte_2 32 "State A" 48 "State B" ;
VAL_ 272 Byte_3 32 "State A" 48 "State B" ;
VAL_ 272 Byte_4 48 "State A" ;
When I'm trying to extract bus signals using above mappings extract_bus_logging() is failing with exception asammdf.blocks.utils.MdfException: wrong encoding "None" for string signal. with trace as following.
signal_mdf = mdf.extract_bus_logging(database_files=database,version = ca_setting.mf4_version,ignore_value2text_conversion=False,ignore_invalid_signals=False,)
File "/home/soham/.local/lib/python3.10/site-packages/asammdf/mdf.py", line 4680, in extract_bus_logging
out = self._extract_can_logging(
File "/home/soham/.local/lib/python3.10/site-packages/asammdf/mdf.py", line 4974, in _extract_can_logging
cg_nr = out.append(
File "/home/soham/.local/lib/python3.10/site-packages/asammdf/blocks/mdf_v4.py", line 3482, in append
raise MdfException(f'wrong encoding "{encoding}" for string signal')
asammdf.blocks.utils.MdfException: wrong encoding "None" for string signal
As I debugged into this issue I found that during append the signal doesn't have encoding(None) so it is raising the above exception.
For this we tried a hack, If the signal.encoding is None we assigned encoding as 'latin-1' in mdf_v4.py and it worked for me.
Could we be missing something in dbc(Database) or is it a defect in asammdf lib.
asammdf lib version is 7.4.2 and 7.3.2.
Has anybody encountered something similar? please suggest best way to proceed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a dbc with state encodings as
VAL_ 272 Signal_1 16 "State A" 32 "State B" ;
VAL_ 272 Byte_2 32 "State A" 48 "State B" ;
VAL_ 272 Byte_3 32 "State A" 48 "State B" ;
VAL_ 272 Byte_4 48 "State A" ;
When I'm trying to extract bus signals using above mappings extract_bus_logging() is failing with exception asammdf.blocks.utils.MdfException: wrong encoding "None" for string signal. with trace as following.
signal_mdf = mdf.extract_bus_logging(database_files=database,version = ca_setting.mf4_version,ignore_value2text_conversion=False,ignore_invalid_signals=False,)
File "/home/soham/.local/lib/python3.10/site-packages/asammdf/mdf.py", line 4680, in extract_bus_logging
out = self._extract_can_logging(
File "/home/soham/.local/lib/python3.10/site-packages/asammdf/mdf.py", line 4974, in _extract_can_logging
cg_nr = out.append(
File "/home/soham/.local/lib/python3.10/site-packages/asammdf/blocks/mdf_v4.py", line 3482, in append
raise MdfException(f'wrong encoding "{encoding}" for string signal')
asammdf.blocks.utils.MdfException: wrong encoding "None" for string signal
As I debugged into this issue I found that during append the signal doesn't have encoding(None) so it is raising the above exception.
For this we tried a hack, If the signal.encoding is None we assigned encoding as 'latin-1' in mdf_v4.py and it worked for me.
Could we be missing something in dbc(Database) or is it a defect in asammdf lib.
asammdf lib version is 7.4.2 and 7.3.2.
Has anybody encountered something similar? please suggest best way to proceed.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions