Why does my Simulink Real-Time model stop with an "Overload limit exceeded" error?

55 views (last 30 days)
I have a Simulink model I want to deploy on a Speedgoat target machine. The model runs fine in Simulink, but when I select "Run on target" the real-time simulation appears to fail and a CPU Overload error is shown in Simulink:
Executing the 'DisconnectConfirmed'command produced the following error:
Application 'myModel' received an error running on target computer 'TargetPC1':
Overload limit (0) exceeded in 0.001s (tid=0) rate with 1 overloads
On the Speedgoat target screen, I see the error "State: TARGET ERROR -> modelName (MODEL ERROR)", as shown in the screenshot below:
Why is this happening, and how can I avoid this?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 Apr 2025 at 0:00
Edited: MathWorks Support Team on 15 Apr 2025 at 10:22
This message indicates that the target computer was unable to complete all of the calculations needed for a time step before the next time step began. See the following documentation for details:
To resolve this issue, consider one of the following solutions:
1. Add an SLRT Overload Options block to your model to allow a small number of overloads to occur via the Max Overloads parameter. This is good for uses where the given application needs a longer initialization time, and is tolerant and won't lose a significant amount of data. However, allowing overloads can cause incorrect results. See: SLRT Overload Options
2. With 'Max Overloads' temporarily set to a high value (eg. 10,000), use Execution Profiling to identify bottlenecks in your SLRT application. See: Execution Profiling for Real-Time Applications
3. Apply Explicit Partitioning to enhance concurrent execution of a real-time application. See: Concurrent Execution on Simulink Real-Time
4. Make sure your model does not contain incompatible blocks that aren't recommended for production code generation, such as To File or Clock blocks.
5. Increase the model step size until the model is able to simulate on the target machine. Note that different Speedgoat machines have different CPUs, so a step size that works on one target machine might not always be able to run on another one. If you have multiple rates in your model, consider increasing the step size for each rate. Use the Timing Legend to visualize the rates in your model.
6. Finally, if you are no longer profiling the real-time execution of your model, configure 'Measure function execution times' to be 'Off' under Code Generation > Verification in the model configuration parameters.

More Answers (0)

Categories

Find more on Get Started with Simulink Real-Time 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!