Vector DBC To CAN M-file
Vector DBC to M-file Conversion
This tool makes use of the Vector CANdbLib to convert your CAN message descriptor files from the DBC format to Matlab compatible m-files that we use for MotoHawk.
Common Errors
Error while running the .exe file on XP:
This occurs because the motohawk_candb2mhcan application has a dependency on the Vector canDBlib. Make sure that all files from the Vector CanDBlib disk are installed. Installing the files should place the cdbmsmo.dll on the computer. If it is not installed to the Windows\System32 directory, than simply make sure the motohawk_canb2mhcan.exe and the cdbmsmo.dll are in the same directory.
Here is a helpful example of how to use this tool.
Database Converter
Woodward has a Vector to Motohawk CAN Database Converter program available to customers. This program, part. no. 8909-1044, makes it possible to take a database obtained via the Vector program, and convert this to an .m script suitable for use with Matlab/MotoHawk.
The program can be run from a command prompt in Windows. The executable file name is motohawk_candb2mhcan.exe. The command syntax would be:
motohawk_candb2mhcan --dbcfile=filename.dbc
where filename.dbc is the name of the .dbc (database) file to be converted. The program automatically names the output .m script file identifiably. For example, if the database file were named j1939.dbc, the outfile filename dbc_j1939_MHCan.m would result.
For purchasing information or more details, contact Woodward sales regarding part. no. 8909-1044, Vector to Motohawk CAN Database Converter.
No Program Installation
When you receive the program file, you do not need to run an installation program. Just place the motohawk_candb2mhcan.exe file in a suitable folder location.
Usage Example
To use the converter program:
Note: This example presumes the .dbc file is named j1939.dbc, and is located in the same folder as the converter .exe file.
- Open a command prompt; in Windows, select Start->Run to open the Run dialog.
- In the Run dialog, enter cmd to open the prompt.
- At the command prompt, use the cd command as needed to change to the folder where the executable and database files are located.
- Enter the command:
motohawk_candb2mhcan --dbcfile=j1939.dbc
The .m script -- dbc_j1939_MHCan.m -- is created and some output information is displayed.
To use the .m script created
- Copy the .m script file to your Matlab Work folder or project folder location where Matlab will find it.
- Place a MotoHawk Read CAN Message block where appropriate in your model.
- Double-click on the block to open the block parameter dialog.
- In the Message Definition field, enter the name of the .m script file (without the .m extension) and append a parenthetic parameter to pass to the message function -- the name of one of the messages defined. From our example, this could be:
dbc_bodybuilder1939auxio_MHCan('Auxio_HCM') - Click OK to close the block dialog, and press Ctrl-D to update the block. As a result, in the MotoHawk Read CAN Message block displays the CAN message information such as the Name and Payload Contents, and the output ports are correctly labeled to reflect the message fields for the named message (here, Auxio_HCM).
Note that the output names match the fields listed in the database editor for the Auxio_HCM shown above, and likewise listed in the .m script shown.
Purchase
To purchase, please visit our webstore]
A better way ...
A native DBC to CAN tool box was created to replace or augment the use of M files in MotoHawk. this work flow enhancer can be found at CAN Network Toolbox for MotoHawk