%% 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(TM) product with CANcaseXL hardware to open and run
% the model.
% * The Spectrum Digital F28335 eZdsp(TM) board to run the target model.
%

% Copyright 2008-2019 The MathWorks, Inc.


%% Transmit and Receive Using a Host Model
%
% <<../demoVNTSL_CANMessaging_Host_Model.png>>
%
% 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
%
% <<../demoVNTSL_CANMessaging_Target_Model.png>>
%
% 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(TM). 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 <matlab:open(fullfile(matlabroot,'examples','vnt','demoVNTSL_CANMessaging_Target.slx')) demoVNTSL_CANMessaging_Target.slx> on the target hardware. 
%
% Open the host side model <matlab:openExample('vnt/demoVNTSL_CANMessaging_HostExample') 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. 
