Open MatinF opened 3 years ago
First there should be a canmatrix
release with LDF support
@MatinF the development branch has support now but you need to install the latest canmatrix
development code and also ldfparser
I didn't get this to work on the development branch, but I came up with an intermediate solution that is working nicely so far:
ldfparser 0.8.0
, to parse the LDF file.It is too much code to share here but thought it could give you a few ideas, if I come across limitations I will let you know, I am able to extract signals, raw and physical values, and also diagnostics like this from MDF files.
This is a minor issue so can be closed. However, I did get to test it with the attached file/LDF in 7.2.0 and I seem to be unable to get it to work. I get below error (I have latest canmatrix installed).
Error: <class 'Exception'>
Traceback (most recent call last):
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\gui\utils.py", line 612, in run
self.output = self._target(*self._args, **self._kwargs)
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\mdf.py", line 4633, in extract_bus_logging
out = self._extract_lin_logging(
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\mdf.py", line 5024, in _extract_lin_logging
dbc = load_can_database(Path(dbc_name))
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\blocks\utils.py", line 1807, in load_can_database
dbs = func(arg, import_type=import_type, key="db", **kwargs)
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\canmatrix\formats\__init__.py", line 71, in loadp
return load(fileObject, import_type, key, **options)
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\canmatrix\formats\__init__.py", line 86, in load
module_instance = sys.modules["canmatrix.formats." + import_type]
KeyError: 'canmatrix.formats.ldf'
Details: 2022-12-27, 15:32:51
--------------------------------------------------------------------------------
<class 'Exception'>
Traceback (most recent call last):
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\gui\utils.py", line 612, in run
self.output = self._target(*self._args, **self._kwargs)
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\mdf.py", line 4633, in extract_bus_logging
out = self._extract_lin_logging(
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\mdf.py", line 5024, in _extract_lin_logging
dbc = load_can_database(Path(dbc_name))
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\blocks\utils.py", line 1807, in load_can_database
dbs = func(arg, import_type=import_type, key="db", **kwargs)
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\canmatrix\formats\__init__.py", line 71, in loadp
return load(fileObject, import_type, key, **options)
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\canmatrix\formats\__init__.py", line 86, in load
module_instance = sys.modules["canmatrix.formats." + import_type]
KeyError: 'canmatrix.formats.ldf'
--------------------------------------------------------------------------------
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\gui\widgets\file.py", line 1661, in extract_bus_logging
mdf = run_thread_with_progress(
File "c:\users\marti\appdata\local\programs\python\python38\lib\site-packages\asammdf\gui\utils.py", line 562, in run_thread_with_progress
raise Exception(thr.error)
Hi Daniel,
Since canmatrix now supports an initial implementation of LIN Description Files, I think it would be a great feature to add for an upcoming asammdf release. The LDF could be a supported format when a user seeks to decode LIN data. It would help further cement asammdf as a tool with great LIN support.
Happy to test this and I can provide sample LIN MF4 data and LDF.