Animate Stateflow Charts Using Simulink External Mode

The Simulink® Real-Time™ software supports the animation of Stateflow® charts in your model to provide visual verification that your chart behaves as expected.

You must be familiar with the use of Stateflow animation. For more information on Stateflow animation, see Animate Stateflow Charts in the Stateflow documentation.

  1. In the Simulink Editor window, select Simulation > Mode > External.

  2. Select Code > External Mode Control Panel.

  3. Select Signal & Triggering.

  4. In the Trigger section of the External Signal & Triggering window:

    • Set Mode to normal.

    • In the Duration box, enter 5.

    • Select the Arm when connecting to target check box.

  5. Click Apply.

  6. Select Simulation > Model Configuration Parameters.

  7. Navigate to the Simulink Real-Time Options node.

  8. Select the Enable Stateflow animation check box.

  9. Click Apply.

  10. Build and download the model to the target computer.

  11. On the toolbar, click the Connect To Target icon  .

    The current Simulink model parameters are downloaded from the development computer to the real-time application.

  12. To start the simulation, click the Run icon   on the toolbar.

    The simulation begins to run. You can observe the animation by opening the Stateflow Editor for your model.

  13. To stop the simulation, click the Stop icon   on the toolbar.

    Note:   Enabling the animation of Stateflow charts also displays additional Stateflow information. The Stateflow software requires this information to animate charts. You can disregard this information.

Was this topic helpful?