Stateflow User's Guide Previous page   Next Page

Sending Stateflow Output Data to Simulink

In Adding Output Data to the Stateflow Chart, you define data output to the Simulink model for the Controller Stateflow diagram. This creates an output port for the data speed that now appears on the right side of the Controller Stateflow block in the Simulink model. This output port gives the Simulink model access to the data speed defined for, and modified in, the Controller Stateflow diagram.

In this topic, you demonstrate that the Simulink model receives the data speed from the Controller Stateflow diagram by displaying it in the Simulink model with the following steps:

  1. From the Simulink Library Browser, in the Simulink Sinks library, add a Display block to the right of the Controller Stateflow block as shown.
  2. Connect the output port for the data speed on the Controller Stateflow block to the Display block as shown.

  1. When you simulate the model, the Controller block modifies the value of the data speed, which it passes on to the Simulink model for display.

  1. Save the model (as SFcontrol2.mdl).

Previous page  Adding Output Data to the Stateflow Chart Simulating Event Triggers and Modified Output Data Next page

© 1994-2005 The MathWorks, Inc.