Main Content

Set up Communication Between Host and Target Models

This example shows you how to set up CAN communication between host-side CAN Vector blocks and target models. This example uses:

  • The Embedded Coder™ product with CANcaseXL hardware to open and run the model.

  • The Spectrum Digital F28335 eZdsp™ board to run the target model.

Transmit and Receive Using a Host Model

The host model receives CAN messages through Channel 1 of Vector CANcaseXL hardware. The model transmits CAN messages using Channel 1 of Vector hardware over the CAN bus.

Transmit and Receive Using a Target Model

The target model contains the eCAN Receive and Transmit blocks that are packed and unpacked using the CAN Pack and Unpack blocks from Vehicle Network Toolbox™. To run this model successfully, the target model configuration settings done must match the host model configuration settings. The message that the target model receives controls the GPIO Digital outputs on the target DSP board.

Communication Between the Host and Target Models

Run the model demoVNTSL_CANMessaging_Target.slx on the target hardware.

Open the host side model demoVNTSL_CANMessaging_Host.slx.

Use the CAN Configuration block to configure a CAN channel on the Vector CAN hardware installed on your system.

Run the host communication model on your system.

CAN Messages are sent between the host model on your system and the target model running on your target hardware. The host receives, unpacks, and displays them using the display blocks and the scopes. The message transmitted by the host model controls the GPIO Digital outputs on the target hardware.

Vector CANcaseXL device was used for this example. You can however connect your models to other supported hardware.