Documentation

Set Stateflow Block Update Method

Stateflow® blocks are Simulink® subsystems. Simulink events wake up subsystems for execution. To specify a wakeup method, in the Chart properties dialog box set Update method (see Specify Chart Properties). Select one of the following wakeup methods:

  • Inherited

    This method is the default update method. It 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. You can set this trigger input event in the Model Explorer to occur in response to a Simulink signal. The Simulink signal can be Rising, Falling, or Either (rising and falling), or in response to a Function Call.

    If you do not define input events, the Stateflow block implicitly inherits triggers from the Simulink model. These implicit events are the discrete or continuous sample times of the Simulink signals providing inputs to the chart. If you define data inputs, 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.

  • Discrete

    The Simulink model awakens (samples) the Stateflow block at the rate that 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.

  • Continuous

    The Stateflow chart updates its state during major time steps only, though it computes outputs and local continuous variables during major and minor time steps. The chart can register zero crossings, which allows Simulink models to sample Stateflow charts whenever state changes occur. The Stateflow chart is also able to compute derivatives for your local continuous variables.

Related Topics

Was this topic helpful?