| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Vehicle Network Toolbox |
| Contents | Index |
| Learn more about Vehicle Network Toolbox |
| On this page… |
|---|
Viewing Messages Information in the CAN Database |
You can get information about the definition of messages in the database, a single message by name, or a single message by ID. To get message information about all messages in the database, type:
msgInfo = messageInfo(database name)
This command returns the message structure of information about messages in the database. For example:
msgInfo =
5x1 struct array with fields:
Name
Comment
ID
Extended
Length
Signals
To get information about a single message by message name, type:
msgInfo = messageInfo(database name, 'message name')
This command returns information about the message as defined in the database. For example:
msgInfo = messageInfo(db, 'EngineMsg')
msgInfo =
Name: 'EngineMsg'
Comment: ''
ID: 100
Extended: 0
Length: 8
Signals: {2x1 cell}
Here the function returns information about message with name EngineMsg in the database db. You can also use the message ID to get information about a message. For example, to view the example message given here by inputting the message ID, type:
msgInfo = messageInfo(db, 100, false)
This command provides the database name, the message ID, and a Boolean value for the extended value of the ID.
To learn how to use it and work with the database, see messageInfo function.
You can get information about all signals in a CAN message. Provide the message name or the ID as a parameter in the command:
sigInfo = signalInfo(db, 'EngineMsg')
You can also get information about a specific signal by providing the signal name:
sigInfo = signalInfo(db, 'EngineMsg', 'EngineRPM')
To learn how to use this property and work with the database, see the signalInfo function.
You can attach a .dbc file to messages and apply the message definition defined in the database. Attaching a database allows you to view the messages in their physical form and use a signal-based interaction with the message data. To attach a database to a message, type:
attachDatabase(message name, database name)
Note If your message is an array, all messages in the array are associated with the database that you attach. |
You can also dissociate a message from a database so that you can view the message in its raw form. To clear the attached database from a message, type:
attachDatabase(message name, [])
Note The database gets attached even if the database does not find the specified message. Even though the database is still attached to the message, the message is displayed in its raw mode. |
For more information, see the attachDatabase function.
![]() | Loading and Creating Messages Using the .dbc File | Monitoring CAN Message Traffic | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |