Products & Services Solutions Academia Support User Community Company

Learn more about Stateflow   

The Stateflow Chart

You will build a Stateflow chart that maintains air temperature at 120 degrees in a physical plant. The Stateflow controller operates two fans. The first fan turns on if the air temperature rises above 120 degrees and the second fan provides additional cooling if the air temperature rises above 150 degrees. When completed, your Stateflow chart should look something like this:

As you can see from the title bar, the chart is called Air Controller and is part of a Simulink model called sf_aircontrol. When you build this chart, you will learn how to work with the following elements of state-transition charts:

Exclusive (OR) states.  States that represent mutually exclusive modes of operation. No two exclusive (OR) states can ever be active or execute at the same time. Exclusive (OR) states are represented graphically by a solid rectangle:

The Air Controller chart contains six exclusive (OR) states:

Parallel (AND) states.  States that represent independent modes of operation. Two or more parallel (AND) states at the same hierarchical level can be active concurrently, although they execute in a serial fashion. Parallel (AND) states are represented graphically by a dashed rectangle with a number indicating execution order:

The Air Controller chart contains three parallel (AND) states:

Transitions.  Graphical objects that link one state to another and specify a direction of flow. Transitions are represented by unidirectional arrows:

The Air Controller chart contains six transitions, from

Default transitions.  Graphical objects that specify which exclusive (OR) state is to be active when there is ambiguity between two or more exclusive (OR) states at the same level in the hierarchy. Default transitions are represented by arrows with a closed tail:

The Air Controller chart contains default transitions:

State actions.  Actions executed based on the status of a state.

The Air Controller chart contains two types of state actions:

 Other types of state actions

Conditions.  Boolean expressions that allow a transition to occur when the expression is true. Conditions appear as labels for the transition, enclosed in square brackets ([ ]).

The Air Controller chart provides conditions on the transitions between FAN1.On and FAN1.Off, and between FAN2.On and FAN2.Off, based on the air temperature of the physical plant at each time step.

Events.  Objects that can trigger a variety of activities, including:

The Air Controller chart contains two edge-triggered events:

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS