Absolute Time Temporal Logic in the Presence of Enabled Subsystems
This model shows the behavior of absolute time temporal logic in the presence of enabled subsystems.
The model contains an enabled subsystem EnabledSubsys which contains a single chart Chart. Initially the option "States when Enabling" for the enable port EnabledSubsys/Enable is set to "held".
The chart itself is very simple. It consists of two states A and B with the transition from A to B guarded by after(5,sec).
The signal driving EnabledSubsys looks as below.
When the model is simulated, we get the following output.
Notice that the transition from A to B happens at t = 9, rather than at t = 7 even though we entered A at t = 2. This illustrates an important semantic rule for absolute time temporal logic in the presence of enabled subsystems. In particular, when a chart is disabled, we do not continue to accumulate the time which the chart spent in the currently active state(s).
If we change the option "States when Enabling" for the enable port EnabledSubsys/Enable to "reset" and re-run the simulation, we see the following behavior:
Notice that now, the transition from A to B happens at t = 10. This is because at t = 5, when the enabled subsystem got re-enabled, Stateflow® will "start fresh". In other words, it executes the default transitions, resets all the temporal counters and performs all the other initializations it did at t = 2. We therefore stay in A for 5 more seconds after t = 5.