Main Content

Signal Monitoring and Parameter Tuning Using Third-Party Product like CANape

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:

  1. 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

  2. Open Configuration Parameters dialog box, go to the Hardware Implementation pane and select the connected Arduino board from the Hardware board list.

  3. Go to Target hardware resources > External mode tab, and choose XCP on Serial as the Communication interface.

  4. Choose CANape as the Host interface.

  5. 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:

  1. 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: <modelname>_CoderXCPSlave.a2l.

  2. 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.

Note

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.