CANape® is one of the third-party products that support integration with Simulink. You can use CANape for optimizing parameterization (calibration) of electronic control units (ECU) (for details, see CANape).
You can use XCP-based External mode simulation over serial connection to connect to the Arduino board from a third-party calibration software like CANape and perform signal monitoring and parameter calibration.
To configure the Simulink model for signal monitoring and parameter tuning using CANape:
In the Simulink model, enable the signals for logging and identify the parameters for tuning. For details, see XCP-Based External Mode Simulation over Serial, TCP/IP, or Wi-Fi Connection
Open Configuration Parameters dialog box, go to the Hardware Implementation pane and select the connected Arduino board from the Hardware board list.
Go to Target hardware resources > External mode tab, and choose
XCP on Serial as
the Communication interface.
CANape as the Host
Click Apply and OK.
After you configure the Simulink model, you can initiate the Monitor and Tune action in Simulink and use the A2L file that is generated, for parameter calibration using CANape:
In the Hardware tab of Simulink toolstrip, click
Monitor & Tune. This action builds and deploys
the model on the target Arduino board, and also generates an A2L file in the
current MATLAB folder path. The A2L file contains XCP slave information for
using in CANape. The file name of the A2L file is in this format:
Import the A2L file into CANape, connect to the XCP slave, and start monitoring of signals and calibration of parameters using the interface in CANape. For more details, refer to the example Calibrate ECU Parameters in CANape Using XCP-based Serial Interface.
The integration of Simulink with CANape using these settings has been tested with CANape 16.0 SP6. The functionality does not work with CANape versions above 17.0 as they do not support XCP on Serial.