Stateflow    

Semantics of State Actions

An entry action is executed as a result of any transition into the state. The state is marked active before its entry action is executed and completed.

A during action executes to completion when that state is active and an event occurs that does not result in an exit from that state. An on event_name action executes to completion when the event specified, event_name, occurs and that state is active. An active state executes its during and on event_name actions before processing any of its children's valid transitions. During and on event_name actions are processed based on their order of appearance in the state label.

An exit action is executed as a result of any transition out of the state. The state is marked inactive after the exit action has executed and completed.


 Semantics of Active and Inactive States Semantics of Transitions