A Stateflow output event has a property called Trigger, which can be configured as follows:
- To specify an edge-triggered output event, set the Trigger property to Either Edge.
- To specify a function-call output event, set the Trigger property to Function call.
More details can be found here:
When the Trigger is set to Either Edge, a Scope block can be used to view the event, or the event signal can be logged to the Simulink Data Inspector. For logging a Function call event, connect a Function-Call Subsystem to the event output port and enable the "Show output port" option in the block parameter of the Trigger Port block inside the subsystem.
The Trigger Port block outputs values as follows:
- 1 for a signal that causes a rising trigger
- -1 for a signal that causes a falling trigger
- 2 for a function-call trigger
- 0 otherwise
Use Markers in the plot for better visualization of the triggers. For more information, refer to the following MATLAB Answer query:
Additionally, the Sequence Viewer can be used to visualize message transition events and the data carried by the messages. Further details are available here: