Are Simulink Diagnostics applicable when generating code and running a model on target hardware?

2 views (last 30 days)
I have a Simulink model, and I use the Simulink Real-time (SLRT) workflow for code generation. For development purposes, I apply High-Integrity System Modeling settings. For example, I have set the model configuration parameter "Detect Overflow" to error. I understand that in normal Simulink model simulation, this will halt the simulation when integer overflow is detected.
If the model is deployed on target hardware, will these settings still follow the same behavior as model simulation in Simulink? For example, if the "Detect Overflow" is set to error, will the execution of real-time application halt in case of integer overflow detection? 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Aug 2025
Edited: MathWorks Support Team on 18 Aug 2025
Diagnostic settings such as Detect overflow, Detect underflow, and others are intended to perform checks during various stages of model development, such as edit-time, diagram updates, simulation within Simulink, or possibly during code generation. When a model is configured for Simulink Real-Time (SLRT), the diagnostics will still be executed during these phases.
However, it's important to note that these diagnostics do not apply during the execution of the real-time application on the target hardware. For example, if an overflow occurs while the model is running on the SLRT target, the diagnostic setting (e.g., Detect overflow set to "error") will not interrupt or stop the execution of the real-time application.
This is because SLRT works by generating code (using Simulink Coder), and then compiling & running that code on a target machine. Simulink Coder doesn't do any extra range checking, so SLRT inherits that behavior.

More Answers (0)

Categories

Find more on Test Model Components in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!