Why do my SIL Test Cases fail when the MIL Test Cases pass for two simulations that both run to completion?
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 8 de Oct. de 2024
Respondida: MathWorks Support Team
el 8 de Oct. de 2024
I have a Simulink model with several tests defined using "Test Sequence" block. I created two test suites, one for model-in-the-loop (MIL) testing and one for software-in-the-loop (SIL) testing. The MIL test suites run with all "verify statements" passing, however, some of the "verify statements" are failing when I run the SIL test suite. Why do my SIL tests fail while my MIL tests all pass?
Respuesta aceptada
MathWorks Support Team
el 8 de Oct. de 2024
During MIL testing, the Simulink model is simulated, whereas during SIL testing, the code generated for the Simulink model under test is run as an executable to simulate the system.
First, inspect the Simulink Test Manager UI to verify that the model actually ran and you did not experience an error during code generation, a run-time error, or a model build issue that caused the Test Case to show as a failure.
If the test did run, a likely issue is there is a mismatch between the output of the generated code ran as a SIL simulation and from the MIL Simulink simulation. You can use the visualization tools within SDI or the Simulink Test Manager to view these differences.
There are many possible reasons for the mismatch between model simulation results and SIL simulation results, and the issue is not likely due to anything in Simulink Test. Some examples of the reasons are described in the following documentations:
1. If you use elements like MATLAB Function Blocks in your model: https://www.mathworks.com/help/releases/R2024a/coder/ug/expected-differences-in-behavior-after-compiling-your-matlab-code.html
2. Numerical issues: https://www.mathworks.com/help/releases/R2024a/rtw/ug/numerical-consistency-of-model-and-generated-code-simulation-results.html
To debug such issues, it is recommended to directly compare the results generated by the model simulation and SIL simulation and examine the differences to determine what specific behavior may be different. The warnings generated during simulation can also provide helpful indicators in identifying the root cause of the issue, since the generated code may be exhibiting unexpected behavior as indicated by the warnings.
To debug the generated code itself during a SIL simulation, the following workflow can be used:
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Test Model Components en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!