Stateflow | ![]() ![]() |
Defining Edge-Triggered Output Events
These are essential conditions that define the use of triggered output events:
Output to Simulink
event with a trigger type: Either Edge.
(See Defining Output Events .)Output to Simulink
has the Trigger
type field set to the equivalent edge triggering type.Example: Edge-Triggered Semantics
In this example the transition from state A
to state B
(in the Stateflow diagram) has a transition action that specifies the broadcast of event1
. event1
is defined in Stateflow to be an Output to Simulink
with an Either edge
trigger type. The Stateflow block output port for event1
is connected to the trigger port of the band pass filter1
Simulink block. The band pass filter1
block has its Trigger
type
field set to Either edge
.
This sequence is followed when state A
is active and the transition from state A
to state B
is valid and is taken:
A
exit actions execute and complete.
A
is marked inactive.
Output to Simulink
event, is registered (but not executed). Simulink is controlling the execution and execution control does not shift until the Stateflow block completes.
B
is marked active.
B
entry actions execute and complete (x = x++
).
band
pass
filter1
block is triggered, executes, and completes.
![]() | Defining Function Call Output Events | Inputting Events from Simulink | ![]() |