The Simulink® Real-Time™ software supports the animation of Stateflow® charts in your model to provide visual confirmation 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 (Stateflow) in the Stateflow documentation.
You must have already set Stateflow states as test points
matlab: open_system(docpath(fullfile(docroot, 'toolbox', 'xpc', 'examples', 'ex_slrt_sf_car')))).
If you have not, see Configure Stateflow States as Test Points.
In the Simulink Editor, select Simulation > Mode > External.
Select Code > External Mode Control Panel.
Select Signal & Triggering.
In the Trigger section of the External Signal & Triggering window:
Set Mode to
In the Duration box, enter
Select the Arm when connecting to target check box.
Select Simulation > Model Configuration Parameters.
Navigate to the Simulink Real-Time Options node.
Select the Enable Stateflow animation check box.
Build and download the model to the target computer.
On the toolbar, click the Connect To Target button .
The current Simulink model parameters are downloaded from the development computer to the real-time application.
To start the simulation, click the Run button on the toolbar.
The simulation begins to run. You can observe the animation by opening the Stateflow Editor for your model.
To stop the simulation, click the Stop button 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.