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

조회 수: 8 (최근 30일)
Jack Daniels
Jack Daniels 2025년 7월 15일
답변: Shishir Reddy 2025년 7월 21일
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