Limits on Sample Time

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:

ModeLower BoundUpper Bound
Interrupt8e-6 s10 s
Polling5e-7 s10 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:

  1. To find the minimum sample time for your model, run SimulinkRealTime.utils.minimumSampleTime in the Command Window.

  2. Change the value of Fixed-step size to a value slightly above the minimum sample time value.

  3. Rebuild and download the model.

See Also


Related Topics

Was this topic helpful?