Using Stateflow     Search    Help Desk 

Chapter 8
Tutorial: Entering a Stateflow Diagram


Overview

Objectives

After completing this tutorial you should be able to:

Provided Models for This Chapter

The files associated with the tutorial example, the running solution, and the demo are included and accessible from the Examples block.

Carousel Tutorial Example

A carousel is a familiar reactive system that you can model with a Stateflow diagram. The system reacts based upon the operator's actions.

This tutorial focuses on learning the notation and the methods to create an initial Stateflow diagram for the carousel. The completed tutorial example cannot be simulated. The provided solution includes a Simulink model and can be simulated. The demo is more elaborate and shows how the Simulink model can be combined with a graphical user interface (GUI).

Basic Operation

The carousel is divided into these main physical components:

The carousel can either be on or off. When the carousel is on, the platform can be stopped or moving, depending on whether a ride is in progress. You have the option of having music play and displaying a video image of the carousel that rotates on the operator's console. You enable audio and video before starting the ride. When the operator of the ride pushes the start button, the platform turns (music plays and video rotates if enabled). The ride lasts the amount of time the operator specifies.

If the carousel exceeds a maximum speed, it stops automatically. There is an emergency stop button on the carousel operator's console if, for any reason, the operator decides the ride needs to be stopped.



[ Previous | Help Desk | Next ]