-
Notifications
You must be signed in to change notification settings - Fork 406
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
EDS to DBC #488
Comments
Thanks for this hint. |
This would be a really useful feature to have as EDS-files are so widespread with a lot of hardware. |
If you guys figure out how to do this I will love to see it. I don't know why companies bother on writing EDS files if the standard is dbc. |
I looked a bit into EDS but I'm not really able to understand how they work and how this could be translated to dbc. Can someone provide some basic example? |
It is great if you want to look at the possibility of implementing this, I will help any way I can. Here is a basic example. To aid communication they supply an EDS file with a lot of information. To make the example easy let's start with PDO only. Receive PDO 1 is a communication object the slave RECEIVES from our master. It has two parameters: CMDdigital and PVdigital. I have made a dbc file with the most important objects as an example, I attach this, the EDS file and a PDF file describing the contents. As you can see all the data in my dbc file can be derived from the EDS file. BUER328X_1_14.eds.zip |
Hi @mrfrenzy Thank you for these details, this will help a lot! Next I'll build some basic code example |
Hi @mrfrenzy, I assembled some code. So my code create this dbc with node_id 1: you can even test the code: |
Hi there, Do you know how to convert a DBC file to EDS? Best, |
Hi, I'm getting a fatal error of repository not found. output from running 'pip install git+https://github.com/ebroecker/canmatrix/tree/eds_support_488' fatal: repository 'https://github.com/ebroecker/canmatrix/tree/eds_support_488/' not found I've also tried running 'pip install git+https://github.com/ebroecker/canmatrix#egg=canmatrix[eds]' but still got error testing the posted 'BUER328X_1_14.eds' file. Update: ldf is not supported INFO - convert - Exporting test.dbc ... Thanks |
Hi @FerrariX , sorry for the maybe wrong link. I forgot to tell: |
Is it possible to convert a .DBC file to .EDS file with this branch @ebroecker? Specifically could you add ability to write .EDS format? Thanks |
Sorry - only Basic Support to decode EDS - encoding maybe not possible, i think dbc lacks needed information for this task |
Hi Eduard, I've been trying this conversion of EDS to DBC on a couple of EDS files (I've sent them via your email), but unfortunately they all fail. The most common error seems to be a missing PDO name - see below the full error trace:
It would be awesome to get this fully tuned for EDS to DBC conversion and potentially integrated into the canmatrix master - this would help a ton of our users. |
@mrfrenzy I also took a look at your example EDS and DBC, which is a great overview. There are some things I am unsure about, however. If we look at the Transmit PDO with ID Your DBC file indeed matches this, resulting in a raw value that may be 0x00 to 0xFFFFFFFF. My challenge is this: In your DBC (and the current canmatrix decoding), the scale factor is 1 with an offset of 0. As a result, the physical value will not be within 0 to 100. It seems to me that the current logic is missing the extraction of the scale/offset values. If we want However, I may be missing some aspect of this. Further, I am unable to find the information about the physical value representation/limits (0 to 100%) outside of the PDF - it does not seem to me that this information is found within the EDS? Presumably, this information could have been added to some extent through the use of e.g. two lines as below:
However, I did not find limit definitions for |
Hi, "UnboundLocalError: cannot access local variable 'pdo_name' where it is not associated with a value" is fixed in branch : I also tried to implement factor and offset. |
Thanks Eduard, now this converts the various EDS files I have in my test folder. Some observations about the outputs:
However, the message in that example screenshot seems to contain some default dummy values:
|
frame-names starting with digit #488
Hi @MatinF ,
for 5. I have no solution for now, maybe I am not using the canopen-python |
Hi Eduard, thanks for the updates. I have created a small script below that essentially identifies the various mapped parameters linked to the receive/transmit PDOs and which then correctly loads the start bit, bit length, name and data type (required to e.g. determined if signed/unsigned). I think this should be fairly simple to incorporate into your existing EDS code in order to correctly load the mapped signals and link them to the PDOs. As for the scale/offset aspect, this (unfortunately) seems to be non-trivial. From what I can tell, EDS files do not directly incorporate this information in the same way that DBC files does. As such, some of the EDS files I have provide this detail in "comments" below the parameters, but in a completely non-standardized manner, making it impossible to extract this directly. But users will have a much better starting point for their DBC if we can make these final updates that will allow them to quickly get all the PDOs mapped correctly. If you get to update this, I will try out the updated version subsequently.
|
As an additional note: I think in practice it only makes sense for the EDS loading mechanism in canmatrix to support loading of receive/transmit PDOs. This is the part that will be relevant to load (and possibly convert to e.g. DBC) for all use cases I can envision. The other messages that currently get loaded are essentially CANopen services like EMCY, NMT, SYNC etc. These are 'generic' messages that are always in every EDS file and have no unique information per CAN node that is relevant in the context of loading the database like this. To some extent, the same goes for the SDOs (Service Data Objects). These have an identical role to OBD2/UDS request/response messages, which also implies that there is no real value to adding the SDO messages in the DBC unless one also completes them with very extensive multiplexing information. For example, you can use an SDO request to request data on a specific parameter by adding the relevant 'index' of that parameter in the data bytes. Here, an SDO request can e.g. read data from a CANopen slave by adding the requested data parameter index in bytes 1 to 3 (counting from zero). The slave responds with the requested value and again stores the index in bytes 1 to 3 and the value in bytes 4 to 7. In principle, this could be encoded into the DBC file by using extended multiplexing and essentially adding all the parameters that can be requested and correctly adding their indices as multiplexors. But I think it may be a more complex addition. In short, for the purpose of getting an initial 'working version' of EDS support, I think adding the PDOs only would be a good way to start. This would also ease a work flow where users might have an EDS for each CANopen node and they want to quickly create a DBC for each of them. Here it would be a problem if each DBC contains the same 'generic' messages, in particular if they contain no real value for the decoding. But open to inputs on this. |
Another update on this: For the sake of good order, I tried digging a bit into whether it would be possible to include at least the SDO service related to 'reading data' from different nodes, as I think this will often come into play in practice, along with the PDO based data. I have a small MF4 log file from our CANedge with some data on which I've tested the below mini DBC file:
You can also see the DBC visualized in an editor below: The DBC uses the following logic:
As evident from the example, the 3-byte If canmatrix supports extended multiplexing like this, I think it would be a very powerful supplement to be able to create the SDO message in an automated way for users. I have also created a short script below that will list all the various data objects along with the relevant details. I hope this helps in enabling the integration of this, but let me know your thoughts.
|
Hi there,
I was wondering if you've considered adding an EDS to DBC converter for use with CANopen EDS files? I think it would be really helpful for many users!
The text was updated successfully, but these errors were encountered: