- 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.
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.
0 个评论
回答(1 个)
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.
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Outputs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!