The sample time you can assign to your model is limited by the kernel and by the complexity of your model.
The kernel enforces lower and upper bounds on sample time:
Mode | Lower Bound | Upper Bound |
---|---|---|
Interrupt | 8e-6 s | 10 s |
Polling | 5e-7 s | 10 s |
In the Solver node in the Configuration Parameters dialog box, set Fixed-step size to a value within these bounds. If you set Fixed-step size to a value outside these bounds and attempt to build and download the real-time application, the application load fails with an error message.
At run time, if you attempt to set the sample time to a value outside these bounds, the kernel prints an error message.
Within these bounds, if you specify too short a sample time for the complexity of your model, the target computer can experience a CPU overload. To address this problem, use the following procedure:
To find the minimum sample time for your model, run SimulinkRealTime.utils.minimumSampleTime
in
the Command Window.
Change the value of Fixed-step size to a value slightly above the minimum sample time value.
Rebuild and download the model.
SimulinkRealTime.utils.getConsoleLog
| SimulinkRealTime.utils.minimumSampleTime