Main Content

Animate Stateflow Charts

During simulation, animation provides visual verification that your chart behaves as you expect. Animation highlights active objects in a chart as execution progresses. For charts in a Simulink® model, you can control the speed of chart animation during simulation, or turn off animation. Animation does not run in accelerator mode.

Set Animation Speeds

In the Stateflow® Editor, in the Debug tab, under Animation Speed:

  • Lightning Fast

  • Fast

  • Medium

  • Slow

  • None

Lightning Fast animation provides the fastest simulation speed by buffering the highlights. During Lightning Fast animation, the more recently highlighted objects are in a bolder, lighter blue. These highlights fade away as simulation time progresses.

The default animation speed, Fast, shows the active highlights at each time step. To add a delay with each time step, set the animation speed to Medium or Slow.

Maintain Highlighting

To maintain highlighting of active states in the chart after simulation ends, in the Debug tab, select Maintain highlighting of active states after simulation ends .

Disable Animation

Animation is enabled by default in Stateflow charts. To turn off animation for a chart, in the Debug tab, select Remove animation highlighting .

Animate Charts as Generated Code Executes on a Target System

If you have Simulink Coder™, you can use external mode to establish communication between a Simulink model and generated code downloaded to and executing on a target system. Stateflow software can use the external mode communication channel to animate chart states. Also, you can designate chart data of local scope to be test points and view the test point data in floating scopes and signal viewers.

For more information, see:

Animation does not run for SIL or PIL modes.