This section describes how to set up CAN communication with C2000 target hardware.
Follow these steps to set up CAN communication between the target hardware and your host computer.
Make sure that the Vector Hardware is installed properly in the Windows® Device Manager.
model that sends message from the board to the host.
Select the target hardware that you are using. The model is set to use a CAN baud of 1Mbit/ sec; you can change the baud settings in the Target Preferences settings.
Use btest32.exe (Vector tool) on the host to receive the messages. ‘btest32.exe’ comes with the Vector drivers that you can find in the driver installation zip file from vector.
Make sure that ‘btest32’ returns the message values with no errors.
Set the baud for btest32 as follows:
For 1 Mbit/s: btest32.exe 1000000
This confirms the following:
The Vector CAN card drivers are working on the host.
The CAN settings, connection, and the cable on the target are working properly.
Download and install the latest version of the Vector XL Library from the
site. After installing the library, copy the file vxlapi64.dll from
the installation folder (for example C:\Softwares\Vector_Driver_Setup_9_3_0\Common) to the
windows root\system32 folder.
This folder name may vary depending on the Windows OS (for example C:\Windows\Sys32).
Run the vcanconf.exe in the vector driver installation.
Right-click the application and select "Add application".
Name the application as ‘MATLAB’ and keep the default settings.
Right-click the first CAN piggy hardware device, select MATLAB, and pick CAN 1.
Right-click the first CAN piggy hardware device again and click Default baud rate to change the baud.
This baud has to match your Simulink model CAN baud that you can change using the Target Preferences settings.
The Vector Hardware Config window is shown.
Open the CCP example model
c28x_ccp_ert. Open the Configuration Parameters dialog box
to select the desired processor and verify the CAN baud. The default baud is 1
To run the model in External mode, click Run.
CAN communication is now set up between your host computer and the C2000 target hardware. Click the Info button on the model to get help on this example.