Is it possible to access CAN messages from .dbc file using message ID in the Vehicle Network Toolbox?

I would like to access and send messages with the structures the database file using message ID (they are short to type and remember) instead of message name and possibly change signal values before sending. I know it can be done using message name but would like to do with the IDs. Is it possible to do that?

 採用された回答

Drew Davis
Drew Davis 2015 年 6 月 9 日
編集済み: Drew Davis 2015 年 6 月 9 日
The canMessage API allows you to do this

3 件のコメント

While canMessage has three inputs:(id, extended, datalength) if I choose to use ID instead of 'messagename'. I was more looking into something like message = canMessage(database, ID) type of structure. The database file has the ID type (standard or extended) information. So I don't wanna make that as input argument.
create a function CANId2Name that maps message ID to message name and then
canMessage(database, CANId2Name(ID))
?
Vasanthilakshmi Karri
Vasanthilakshmi Karri 2016 年 8 月 8 日
編集済み: Vasanthilakshmi Karri 2016 年 8 月 8 日
I have the same application and I am new to CAN. I am not quite sure how to create this function CANId2Name. Do you have any sample code?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by