| 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… |
|---|
To use a CANdb file, load the database into your MATLAB session. At the MATLAB command prompt, type:
db = canDatabase('filename.dbc')Here db is a variable you chose for your database handle and filename.dbc is the actual file name of your CAN database. If your CAN database in not in the current working directory, type the path to the database:
db = canDatabase('path\filename.dbc')Note CANdb file names containing non-alphanumeric characters such an equal sign, ampersands, and so forth are incompatible with the Vehicle Network Toolbox. Rename any CANdb files with non-alphanumeric characters before you use them. |
This command returns a database object you can use to create and interpret CAN messages using information stored in the database. Refer to the canDatabase function for more information.
This example shows you how to create a message using a database constructed specifically for this purpose. This database has one message, Msg. To try this example, create messages and signals using definitions in your own database.
Create the CAN database object:
d = canDatabase('Mux.dbc')Create a CAN message using the message name in the database:
message = canMessage(d, 'Msg')
To add a database to the CAN channel canch, type:
canch.Database = canDatabase('Mux.dbc') For more information, see the Database property.
When you make changes to a database file:
Reload the database file into your MATLAB session using the canDatabase function.
Reattach the database to messages using the attachDatabase function.
![]() | Vector CANdb Support | Other Uses of the CAN Database | ![]() |

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 |