Stateflow® blocks are Simulink® subsystems. Simulink events wake up subsystems for execution. To specify a wakeup method, set Update method in the Chart properties dialog box (see Specify Chart Properties). Select one of the following wakeup methods:
This is the default update method. Specifying this method causes input from the Simulink model to determine when the chart wakes up during a simulation.
If you define input events for the chart, the Stateflow block is explicitly triggered by a signal on its trigger port originating from a connected Simulink block. This trigger input event can be set in the Model Explorer to occur in response to a Simulink signal that is Rising, Falling, or Either (rising and falling), or in response to a Function Call. See Activate a Stateflow Chart Using Input Events.
If you do not define input events, the Stateflow block implicitly inherits triggers from the Simulink model. These implicit events are the sample times (discrete or continuous) of the Simulink signals providing inputs to the chart. If you define data inputs (see Share Output Data with Simulink), the chart awakens at the rate of the fastest data input. If you do not define any data input for the chart, the chart wakes up as defined by its parent subsystem's execution behavior.
The Simulink model awakens (samples) the Stateflow block at the rate you specify as the block's Sample Time property. An implicit event is generated at regular time intervals corresponding to the specified rate. The sample time is in the same units as the Simulink simulation time. Other blocks in the Simulink model can have different sample times.
Stateflow charts maintain mode in minor time steps and can define continuous states and their derivatives. In addition, charts can register zero crossings, allowing Simulink models to sample Stateflow charts whenever state changes occur.