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
How do I assign J1939 standard to a message? #574
Comments
I'm in no way an expert when it comes to J1939, but I suspect that the DBC writing code simply does not consider its peculiarities. do you know anything about this @juleq? |
There is only minimal support of j1939 in cantools. That said, what was your expectation? I do not remember if CANdb++ does interpret j1939 specifics. But note that the ID remains extended, it is just interpreted according to j1939 by upper layers. We have the Vector tooling with j1939 option, but I am not sure if the CANdb++ variant is any different. |
Hi,
So, creating a J1939 DBC file from scratch might be very hard (and frustrating). For your use case this:
I hope this helps! Good luck! P.S.: If you need CAN FD together with J1939, checkout the latest version of CANdb++. The version I currently have does not support having both CAN FD and J1939 frames in the same file. My CANdb++ version is older than the related SAE documents. Maybe Vector has updated the CANdb++ in the meanwhile. |
Hi @geo4711, Edit: Or is it possible to create two databases (one j1939 and a normal one) and merge them together before i dump them into a new file? BR |
Hi @rotschaedel, |
Hi @rotschaedel,
Now here's the workaround:
Example code:
This worked for me, hope it does for you as well. Of course you can try to assign the attributes from scratch. But I found that quite tricky due to the nested object hierarchy. BR P.S.: Implementing a proper fix would be a bigger effort (to be backwards compatible for dbcs not using J1939 etc.). |
Hi @geo4711 , thanks for the workaround! I will try to implement it in the next days. But one question if i understand it correctly: I should create in my j1939 template a dummy message which i use for not j1939 messages? Sadly I'm not really into the source code, so I'm probably not able to create this pull request. But thanks again for your help! BR Edit: When trying your workaround i receive the error message when dumping the file: |
Hi @rotschaedel,
BR |
There i get the same error message. I think the problem is dump_file. When i remove it, the program runs without errors. BR |
Hello,
I want to create a dbc file with a J1939 message. But after i save the file and open it with another program the message just shows CAN Extended as ID Format. Could anyone explain to me why it is not working?
Here a short code example:
And a picture how it looks like in CANdb:
The text was updated successfully, but these errors were encountered: