How to perform back-to-back Testing of C-custom code in Simulink

10 次查看(过去 30 天)
I am about to use Simulink test for custom C code within simulink. In Simulink model I implemented my submodel and as well I have created its C-source code equivalnt. Now I would like to test my own created code against Simulink submodel.
I am trying to use Simulink test manager for it and configure it for back-to-back testing...
Can I specify and refer to my own code ?
I suppose to run my submodel in parallel with custom C code.

回答(1 个)

Shishir Reddy
Shishir Reddy 2025-7-21
Hi Jack
Kindly refer to the following points to gain understanding on performing back-to-back testing between the Simulink submodel and the custom C code in Simulink Test Manager.
  • Import your custom C code into Simulink using a C MEX S-Function block.
  • Open Simulink Test Manager and create a new test using "Create Test for Model Component".
  • Select the option "Perform back-to-back testing".
  • Set Simulation 1 to Normal mode to run the Simulink submodel.
  • Set Simulation 2 to Software-in-the-Loop (SIL) mode to run your custom C code.
  • Make sure your C code setup supports SIL execution (compiled correctly and compatible with Simulink).
  • Run the test to automatically compare outputs from both implementations.
For more information regarding Simulink Test Manager, kindly refer the following documentation - https://www.mathworks.com/help/sltest/ref/simulinktestmanager.html
I hope this helps

类别

Help CenterFile Exchange 中查找有关 Outputs 的更多信息

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by