Why am I unable to use an inherited sample time in my discrete-time integrator in Simulink?

28 views (last 30 days)
When I try setting the sample time in my discrete-time integrator to '-1' I get the following error:
 
A discrete sample time must be entered in '<block_name>'.
Where "block_name" is the name of the actual block.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Nov 2016
This error message often occurs when the solver is set to 'Variable-step' and no blocks in the model specify a sample time. This configuration results in the solver block having no place to inherit its sample time from.
To resolve this issue use either of the following two approaches:
1) Make sure that at least one block in your design specifies a sample time
2) Use a fixed-step solver
The error can also occur when the discrete-time integrator block has additional input ports for the initial condition and/or external reset. When the solver is set to variable-step, the integrator's step can only be inherited when all inputs' step sizes are multiples. The inherited integrator step size will be the lowest of the input sample times. When the solver is fixed-step, all input ports must have the same step size for the integrator block's step to be inherited.
To resolve this issue:
1) For variable-step solvers, make sure that the specified sample times are multiples of each other
2) For fixed-step solvers, make sure that the specified sample times are equal for all input signals

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!