State Chart

State charts for modeling control logic

A state chart is a representation of an event-driven (reactive) system. In an event-driven system, the system makes a transition from one state or mode to another, if the condition defining the change is true.

For example, you can use a state chart to represent the automatic transmission of a car. The transmission has these operating states: park, reverse, neutral, drive, and low. As the driver shifts from one position to another, the system transitions from one state to another, such as from park to reverse.

State charts are often used to model complex logic including:

  • Scheduling a sequence of tasks or steps for a system
  • Defining fault detection, isolation, and recovery logic
  • Supervising how to switch between different modes of operation

Using state charts can provide additional capabilities beyond traditional finite state machines, including:

  • Modeling hierarchical states for large-scale systems
  • Adding flow graphs to define complex decision logic
  • Defining orthogonal states to represent systems with parallelism

For details on creating state charts and integrating them into a Simulink® model, see Simulink and Stateflow®.

State chart, modeled in Stateflow, showing state hierarchy. Inner states are substates (children) of the outer state (called a superstate or parent).

See also: control logic, finite state machine, state diagram, control systems, embedded systems, state chart videos