Stateflow | ![]() ![]() |
Temporal Logic Events
Although temporal logic does not introduce any new events into a Stateflow model, it is useful to think of the change of value of a temporal logic condition as an event. For example, suppose that you want a transition to occur from state A
exactly 10 clock cycles after activation of the state. One way to achieve this would be to define an event called ALARM
and to broadcast this event 10
CLK
events after state A
is entered. You would then use ALARM
as the event that triggers the transition out of state A
.
An easier way to achieve the same behavior is to set a temporal logic condition on the CLK event that triggers the transition out of state A.
Note that this approach does not require creation of any new events. Nevertheless, conceptually it is useful to think of this expression as equivalent to creation of an implicit event that triggers the transition. Hence, Stateflow supports the equivalent event notation (see Temporal Logic Events).
Note that the event notation allows you to set additional constraints on the implicit temporal logic "event," for example,
This expression says, "Exit state A
if the temperature is cold but no sooner than 10
clock cycles."
![]() | Conditional and Event Notation | Special Symbols | ![]() |