Difference between revisions of "MotoHawk:Vector Database to MotoHawk CAN (.m script) Converter"

From MotoHawk
Jump to navigationJump to search
(Database Converter)
(Starting with MotoHawk 2015a Beta1, this product is part of MotoHawk)
Line 1: Line 1:
 
== Database Converter ==
 
== 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.
+
Since the MotoHawk 2015a Beta 1 release, MotoHawk now includes a '''Vector to Motohawk CAN Database Converter''' script. This MATLAB script 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:
+
The script can be run from the MATLAB command prompt. The script name is motohawk_candb2mhcan. The command syntax would be:
  
motohawk_candb2mhcan --dbcfile=filename.dbc
+
>>motohawk_candb2mhcan('filename.dbc', fullfile(pwd,'dbc_j1939_MHCan.m'))
 
 
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.
+
where ''filename.dbc'' is the name of the .dbc (database) file to be converted. The second parameter would be the desired output .m script file to be created. For example above, if the database file were named '''j1939.dbc''', the outfile filename '''dbc_j1939_MHCan.m''' would be created in the current working directory.
#In the Run dialog, enter '''cmd''' to open the prompt.<BR>[[Image:cmd0.png]]<BR>
 
#At the command prompt, use the cd command as needed to change to the folder where the executable and database files are located.<BR>[[Image:cmd3.png]]<BR>
 
#Enter the command:<BR>motohawk_candb2mhcan --dbcfile=j1939.dbc <BR>The .m script -- dbc_j1939_MHCan.m -- is created and some output information is  displayed.<BR>[[Image:cmd4.png]]
 
  
 
=== Example Files ===
 
=== Example Files ===
Line 44: Line 27:
 
#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:<BR>dbc_bodybuilder1939auxio_MHCan('Auxio_HCM')<BR>[[Image:Block-parm1.png]] <BR><BR>
 
#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:<BR>dbc_bodybuilder1939auxio_MHCan('Auxio_HCM')<BR>[[Image:Block-parm1.png]] <BR><BR>
 
#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). <BR>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. <BR>[[Image:ReadCANblk1.png]]<BR>
 
#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). <BR>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. <BR>[[Image:ReadCANblk1.png]]<BR>
 +
 +
 +
== Legacy Database Converter ==
 +
 +
Woodward has discontinued the product '''Vector to Motohawk CAN Database Converter (8909-1044).''' This was a command line program, part. no. 8909-1044, which made 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 used to be run from a command prompt in Windows. The executable file name was motohawk_candb2mhcan.exe. The command syntax was:
 +
 +
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'''.

Revision as of 13:53, 5 February 2015

Database Converter

Since the MotoHawk 2015a Beta 1 release, MotoHawk now includes a Vector to Motohawk CAN Database Converter script. This MATLAB script 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 script can be run from the MATLAB command prompt. The script name is motohawk_candb2mhcan. The command syntax would be:

>>motohawk_candb2mhcan('filename.dbc', fullfile(pwd,'dbc_j1939_MHCan.m'))

where filename.dbc is the name of the .dbc (database) file to be converted. The second parameter would be the desired output .m script file to be created. For example above, if the database file were named j1939.dbc, the outfile filename dbc_j1939_MHCan.m would be created in the current working directory.

Example Files

Here is an example of a .dbc file, as displayed in the KVaser database editor. Note the listed CAN messages in the left pane; one is selected, and its message fields are shown in the bottom-right pane under Signal Name:

DB-ed-1.png

Here is part of the .m script created from the same file as above, in a format more familiar to MotoHawk CAN message users:

M-script1.png

To use the .m script created

  1. Copy the .m script file to your Matlab Work folder or project folder location where Matlab will find it.
  2. Place a MotoHawk Read CAN Message block where appropriate in your model.
  3. Double-click on the block to open the block parameter dialog.
  4. 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')
    Block-parm1.png

  5. 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.
    ReadCANblk1.png


Legacy Database Converter

Woodward has discontinued the product Vector to Motohawk CAN Database Converter (8909-1044). This was a command line program, part. no. 8909-1044, which made 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 used to be run from a command prompt in Windows. The executable file name was motohawk_candb2mhcan.exe. The command syntax was:

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.