- Open the SIL/PIL Manager by navigating to Apps > SIL/PIL Manager in Simulink.
- Choose SIL Simulation as the verification mode.
- In the “MODE” option, in the top left corner, select “SIL/PIL Simulation Only”. This option runs the generated code using SIL/PIL.
- Click on “Run Verification” to run the SIL simulation.
How to run SIL for an existing generated code?
12 views (last 30 days)
Show older comments
I have a generated code from a Simulink model, and I need to run SIL for it without regenerating the code. It seems there are different approaches for this task, like legency_code, s-function builder, etc. I wonder what is the best and most automated approach to build a SIL block from an existing generated code with no need to configure the code interface from my side? Since it is a generated code by MATLAB and not handwritten custom code, I think there should be an approach that the interface and other configurations should be identified by MATLAB automatically to build a new SIL block. Thanks
0 Comments
Answers (1)
Aabha
on 27 Feb 2025
To run a Software-in-the-Loop (SIL) simulation using existing generated code from a Simulink model without regenerating the code, the SIL/PIL Manager App can be used, from the Simulink toolstrip. Ensure that you have Embedded Coder installed, as it provides the necessary tools for SIL Simulation. The SIL block can be generated using the following steps:
This method will configure the model automatically for SIL simulation. Please note that, the code will need to be regenerated every time the model is modified, or the compilation is out-of-date, which can be observed in the diagnostic viewer. Please refer to the below documentation links for more information on the SIL workflow:
I hope this answers the question.
0 Comments
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!