Skip to content

Convert kcd to DBC: No "GenMsgCycleTime" records #847

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

Closed
MamoruAsagami opened this issue Mar 5, 2025 · 6 comments
Closed

Convert kcd to DBC: No "GenMsgCycleTime" records #847

MamoruAsagami opened this issue Mar 5, 2025 · 6 comments
Assignees
Labels

Comments

@MamoruAsagami
Copy link

When you convert from .kcd to .dbc, message cycle time info is lost.
Message cycle times are coded as Message.interval as in <Message ... interval="100"> in .kcd, which should be transformed as below in .dbc.

BA_DEF_ BO_ "GenMsgCycleTime" INT 0 0;
BA_DEF_DEF_ "GenMsgCycleTime" 0;
BA_ "GenMsgCycleTime" BO_ <can id 1> 100;
BA_ "GenMsgCycleTime" BO_ <can id 2> 50;
...

@ebroecker
Copy link
Owner

example.zip

Hi @MamoruAsagami
I can't reproduce this issue. The attached example seems to convert correct to:

...
BO_ 16 SomeMessageName: 8 Vector__XXX
 SG_ someSignalName : 24|32@1- (1,0) [-2147483648|2147483647] "W" Vector__XXX

...

BA_DEF_ BO_ "GenMsgCycleTime" INT 0 65535;
BA_ "GenMsgCycleTime" BO_ 16 100;

@MamoruAsagami
Copy link
Author

I should have said 'Convert kcd to DBC: No "GenMsgCycleTime" records when Message elements don't have triggered attribute.'
See the attached zip file.
issue_847.kcd ... What I received.
issue_847.dbc ... I used canmatrix to convert issue_847.kcd. No problems.
issue_847a.kcd ... I used CANBabel to convert issue_847.dbc. No problems.
issue_847a.dbc ... I used canmatrix to convert issue_847a.kcd. No "GenMsgCycleTime" records!
issue_847LessTriggered.kcd ... I edited issue_847.kcd to delete triggered="true" of <Message ... >.
issue_847LessTriggered.dbc ... I used canmatrix to convert issue_847LessTriggered.kcd. The problem was reproduced.
Incidentally, when I changed to triggered="false" the conversion showed no problems.

issue847ToReproduce.zip

@ebroecker
Copy link
Owner

ebroecker commented Mar 19, 2025

Hi @MamoruAsagami

thanks for clearification, so we don't need to have the "triggered" attribute to know it's a cyclic message. We should only look at the "interval" attribute.
I'll provide a pr next

ebroecker added a commit that referenced this issue Mar 19, 2025
@ebroecker
Copy link
Owner

Hopefully fixed in branch:

https://github.com/ebroecker/canmatrix/tree/issue_847

@MamoruAsagami
Copy link
Author

I confirmed the problem was solved in the branch issue_847.

Since I'm not sure if I am eligible to "Close with comment", I simply "Comment."

@ebroecker
Copy link
Owner

#fixed with pr #849

ebroecker added a commit that referenced this issue Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants