Why do I get a sample time error when I put a Discrete sample time block in a Control Flow block in Simulink 4.1 (R12.1)?

5 views (last 30 days)
The documentation says that Control Flow subsystems are treated like enabled subsystems, but the discrete sample time is causing a problem. The documentation below specifically states that these control flow blocks are 'enabled subsystems'
The error I get is as follows:
 
"Sample time [0.0005 0] of block 'quickTest3/ATF1/ATF1 Small Error Controller Y/controller x 1' is invalid "

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Nov 2016
This is not a bug. Action subsystems are similar to enabled subsystems, but they are not identical. The rule for sample times is that all blocks inside the Action subsystem should run at the same rate as the "IF" block that is driving the Action subsystem. This is why you are getting this error. This has been added to the documentation for Simulink 5.0 (R13).
In some cases, it might be useful to turn on "Sample Time Colors" menu item under: "Format -> Port/Signal Displays", to locate where the sample time mismatch is.

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!