Stateflow User's Guide Previous page   Next Page

Building an On-Off Control Model

In this section, you start learning how to use Stateflow by creating a Simulink model with a single Stateflow block that provides on-off control. This model is the basis for further improvements that you add and test in the remainder of this Getting Started guide. As you continue to build and improve the growing model, you learn how to use Stateflow in Simulink models.

Use the following procedure topics to create a simple control model with on-off control:

  1. Creating a Simulink Model with a Stateflow Block -- Start a model in Simulink containing a Stateflow block.
  2. Saving a Simulink Model -- Save and name the Simulink model as soon as you create it.
  3. Opening the Diagram for a Stateflow Block -- Open the Stateflow diagram for the Stateflow block in the Simulink model.
  4. Drawing States in Stateflow Diagrams -- Start editing the Stateflow diagram by drawing states.
  5. Drawing Transitions in a Stateflow Diagram -- Draw transitions between the states of the Stateflow diagram.
  6. Adding a Trigger Event to the Stateflow Diagram -- Define the input event from Simulink that triggers the execution of the Stateflow diagram in the Simulink model.
  7. Sending a Trigger Event to the Stateflow Chart -- Program the Simulink model to send a trigger event to test the execution of the Stateflow diagram.

Previous page  Controlling with States and Transitions Creating a Simulink Model with a Stateflow Block Next page

© 1994-2005 The MathWorks, Inc.