-
-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Support LIN Description File (LDF) as supplement to DBC #480
Comments
First there should be a |
@MatinF the development branch has support now but you need to install the latest |
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:
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).
|
I wanted to revisit this as we have a number of users that would like to use LDF files to decode their raw LIN bus data in asammdf. I tried the latest build below, but it looks like it does not currently support decoding of the test data I attached: |
As a follow up on this, I seem to be able to load and parse an LDF file now with the latest canmatrix (and ldfparser installed) as outlined in this post: ebroecker/canmatrix#531 - but I am still unable to use this functionality to decode data in asammdf using the sample files attached. I am doing a new article on LIN description files and it would be awesome to showcase asammdf for some of the basic decoding functionality if we can get this supported, in particular as it would allow for a like-for-like comparison vs. DBC files for LIN decoding, since asammdf also supports this. |
Hi again Daniel, just wanted to check if you'd have the chance to check if this can be supported? I think the base functionality is there, but for some reason the decoding is not working. Perhaps I am missing some dependency installation to get it right. As per my previous post, the below zip contains raw LIN bus data and an LDF, so it should enable the possibility to test if this is working in the latest version or not. Let me know if I should take some specific steps to test this out |
Hi Daniel, thanks a ton! I tested this out as follows:
I can verify that I can now decode via the LDF file and 'to some extent' get the expected result. However, one critical challenge with LDF vs. DBC files is the support for 'multiple physical value ranges'. I explain this in my article on LIN Description Files, see the section "Example 2: Convert BatteryCurrent". In short, the decoding scale/offset values will depend on the value of the raw data. Currently, the use of the canmatrix 'master' as a dependency means that there is no support for the multiple physical value ranges at all, implying that only the last entry in a range of decoding rules will be loaded at all into canmatrix. However, Eduard fixes this in the development branch of canmatrix, so that all the ranges are available in the matrix object. However, it looks like asammdf only takes into account the last entry in the range, even if I install the development branch of canmatrix in the virtual environment. This is why in your screenshot, most of the values are 'invalid' - this is because essentially the incorrect decoding factor/offset is loaded. To illustrate this, consider below the
As per the If this can be incorporated, I believe that it would be possible to fully support LDF files within asammdf, making it a game changer for LIN bus decoding use cases. Let me know if anything is unclear. |
@MatinF please try the |
@danielhrisca Awesome, this indeed fixes the scaling and offset from what I can tell, enabling the correct decoding of data! The only 'missing' aspect is that the unit still seems to be extracted as before, i.e. from the last entry, rather than being dependent on the range. This may be more difficult to fix, but you can see it e.g. based on the SOC value as below. The value 80.0 is correct, but the unit was supposed to be % in this area: |
It is not possible to change the unit because it would bring in too much complexity |
That makes sense, I understand - could an alternative then be to instead replace the unit with |
To improve this I've made the change to use the unit found in the first scale range |
I think that change works well and yields the relevant unit in the vast majority of cases - well spotted! If possible, it would be great to get this loaded into the development branch, along with (if possible) a dependency on the canmatrix development branch (as that is required in order to support the LDF functionality fully). If the latter is not possible, I'll try to hear Eduard from canmatrix if he can do a new release of canmatrix with this included. |
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.
The text was updated successfully, but these errors were encountered: