| Stateflow User's Guide | ![]() |
Setting the Stateflow Block Update Method
Stateflow blocks are Simulink subsystems. Simulink events wake up subsystems for execution. To specify a wakeup method for a chart, set the chart's Update method property in the Chart dialog for the chart (see Specifying Chart Properties). Choose from 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 Stateflow 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 Defining 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 Sharing Input and Output Data with Simulink), the chart awakens at the rate of the fastest data input. If you do not define any data inputs for the chart, the chart wakes up as defined by its parent subsystem's execution behavior.
Simulink awakens (samples) the Stateflow block at the rate you specify as the block's Sample Time property. An implicit event is generated by Simulink at regular time intervals corresponding to the specified rate. The sample time is in the same units as the Simulink simulation time. Note that other blocks in the Simulink model can have different sample times.
Simulink wakes up (samples) the Stateflow block at each step in the simulation, as well as at intermediate time points that can be requested by the Simulink solver. This method is consistent with the continuous method in Simulink.
See Interface to External Sources for more information.
| Setting Properties for All Charts in the Model | Implementing Simulink Update Interfaces | ![]() |
© 1994-2005 The MathWorks, Inc.