Stateflow

Stateflow

Stateflow

Product catalog summary
Introduction to Stateflow
Stateflow is a tool for modeling and simulating decision logic using state machines and flow charts. It allows for the integration of graphical and tabular representations to model system reactions to events, time-based conditions, and external inputs. Stateflow is particularly useful for designing logic in supervisory control, task scheduling, and fault management applications.
Key Features
  • Graphical and tabular modeling environment for complex logic.
  • Deterministic execution semantics with support for hierarchy, parallelism, and events.
  • State diagrams, transition tables, and matrices for finite state machines.
  • Flow charts and truth tables for algorithm representation.
  • State diagram animation and debugging tools for design analysis.
  • Static and run-time checks for design consistency and error detection.
Designing Logic
Stateflow provides interfaces for modeling system logic using state machines. It supports graphical and tabular formats, allowing for the representation of system modes as states and transitions. Logic can be defined in C or MATLAB, with data management facilitated by the Simulink Model Explorer. Stateflow also provides notifications for potential design issues before execution.
Graphical Design
The Stateflow Editor allows for the creation of state machines and flow charts using a graphical palette. It supports the integration of flow charts, Simulink subsystems, MATLAB functions, and truth tables. The editor includes edit-time checks to ensure valid design.
State Transition Tables
State transition tables offer a structured environment for modeling state machines, with features like dropdown menus for state names and syntax checks. Truth tables allow for modeling logic without state maintenance, with diagnostic checks for condition specification.
Integrating Components and Scheduling Algorithms
Stateflow components can be integrated with MATLAB and Simulink functions, custom C code, and truth tables. Components can be reused across diagrams and models, and scheduling can be managed using time-based and condition-based logic.
Simulating and Analyzing Models
Stateflow provides tools for simulating models and analyzing results. It includes debugging capabilities, data visualization options, and the ability to log data for post-processing in MATLAB.
Validating Design and Code Generation
Stateflow can be used with Simulink products for design validation and code generation. It supports requirements mapping, standards compliance checks, and model coverage metrics. Code generation options include C, C++, HDL, and PLC code.
Additional Resources
For more information, examples, and system requirements, visit the MathWorks website. Trial software, sales contacts, technical support, and training services are also available.
See more

Catalog excerpts

Stateflow-1

Stateflow Design and simulate state machines Stateflow® is an environment for modeling and simulating combinatorial and sequential decision logic based on state machines and flow charts. Stateflow lets you combine graphical and tabular representations, including state transition diagrams, flow charts, state transition tables, and truth tables, to model how your system reacts to events, time-based conditions, and external input signals. With Stateflow you can design logic for supervisory control, task scheduling, and fault management applications. Stateflow includes state diagram animation and static and run-time checks for testing design consistency and completeness before implementation. Key Features ▪ Modeling environment, graphical components, and simulation engine for modeling and simulating complex logic ▪ Deterministic execution semantics with hierarchy, parallelism, temporal operators, and events ▪ State diagrams, state transition tables, and state transition matrices representing finite state machines ▪ Flow charts, MATLAB functions, and truth tables for representing algorithms ▪ State diagram animation, state activity logging, data logging, and integrated debugging for analyzing the design and detecting run-time errors ▪ Static and run-time checks for transition conflicts, cyclic problems, state inconsistencies, data-range violations, and overflow conditions ▪ Mealy and Moore finite-state machines Getting Started with Stateflow 3:25 Learn to build and simulate a state machine. Designing Logic Stateflow provides graphical and tabular interfaces for modeling system logic using state machines. In a state machine, you model the system’s modes of operation as states and represent the logic for switching between modes using transitions and junctions. You can model the different components in your system as states that execute exclusively or in parallel. Stateflow lets you manage the complexity of your design by organizing state diagram objects, functions, and components hierarchically. In Stateflow you can represent combinatorial logic graphically with flow charts and in tabular format with truth tables. Designing logic involves defining conditions to be checked and subsequent actions to be performed. Stateflow enables you to define conditions and actions in C or in MATLAB®. You can manage the data used in conditions and actions from the Simulink® Model Explorer. Before executing your design, Stateflow notifies you of possible state inconsistencies, unused data and events, and invalid transitions.

 Open the catalog to page 1
Stateflow-2

flang-Bang Cwrtre*w to iisF_bDtler * QBang-Bang CnnlroKer ► entry: turn_bcHler(OFF) % SUtedow (wrxfi*rT| ^boiler/Bang- Sang Con[roller/Ci*n_boilef I a f liD Uitf File Edit View Display Chan Simulation Analysis Code Toolj Hetp * i^sf.bniltr * QBaflg'Bang Controller * Qtum_boiler Stateflow diagram defining the logic for a boiler temperature control system. The diagram uses graphical functions (right side) to implement utility algorithms called by the heater system (left side). Designing Logic Graphically Stateflow provides an editor and graphical objects for drawing state machines and flow charts....

 Open the catalog to page 2
Stateflow-3

file E<J'< QisplBy cm-n SimuidiHMi flnaijuu £enle looii HHp I Stateflow Pattern: IF-ELSEIF-ELSEIF-ELSE I a J| 0 l| £3 Packet Send Logic Elseif condition: EFseif action: function task = sendjogic function task = send_logic Stateflow diagram (left) that uses a graphical function (right) generated by the Pattern Wizard (center). The Stateflow Editor provides edit-time checks to identify illegal object placement and invalid transitions. Accelerating the pace of engineering and science

 Open the catalog to page 3
Stateflow-4

*j Stateflow (ctwrt) jf_aiKontroVAir Comfoiier ■ Ealt £<Jit Ytew ffisruay Chart Simulation analysis cod* lools Help i%isl_aifConvoi»QAir CorNroller Stateflow Editor with a model of a cooling system. States with overlapping boundaries are highlighted in red. Designing Logic with Tables State transition tables in Stateflow provide a structured environment for modeling state machines. You build a state machine by adding rows for states, and columns for the transitions between states. State transition tables help you create state machines by providing dropdown menus for state names, automatic completion...

 Open the catalog to page 4
Stateflow-5

4 Staieflow (£n*h cable} *f>roaft/Meide LagitR.iwiich" I o [ 3 1 H File Edit Senngi Add Help (.eft; Truth table implementing the logic for selecting a valid sensor reading in a fault-detection algorithm. Right: Automatically generated graphical representation of the truth table. Integrating Components and Scheduling Algorithms After creating components in Stateflow, you can integrate them with other components to build your state machine algorithm. Stateflow components can contain MATLAB and Simulink functions, custom C code, graphical functions, and truth tables. In your algorithm, you can schedule...

 Open the catalog to page 5
Stateflow-6

Integrating Components into your Design You can reuse a component across diagrams and models by right-clicking it, converting it to an atomic subchart, and placing it in a library. To use the component, you drag it from the library and drop it into your diagram or model. When you update a component in the library, all instances of the component are automatically updated. You can organize components and functions hierarchically to represent your system concisely and accurately. Reusing States Multiple Times in a Diagram 3:47 Create and reuse components in Stateflow for large-scale modeling. Scheduling...

 Open the catalog to page 6
Stateflow-7

Analyzing Results During simulation you can visualize the simulation results by: ▪ Viewing states and data with Simulink displays and scopes ▪ Viewing logged data in the Simulation Data Inspector ▪ Building custom displays with MATLAB Alternatively, you can log diagram and state activity data for post-processing in MATLAB. Simulation data visualization options in Stateflow. Top left: Simulink Data Inspector for comparing specific signals; bottom left: custom MATLAB interface for analyzing data; right: Simulink Signal Selector for comparing specific states. Validating the Design and Generating...

 Open the catalog to page 7

All The MathWorks catalogs and technical brochures

  1. SimEvents

    7  Pages

  2. SimDriveline

    7  Pages

  3. SimHydraulics

    7  Pages

  4. SimRF

    6  Pages

  5. MATLAB Coder

    5  Pages

  6. OPC Toolbox

    5  Pages

  7. SimBiology

    6  Pages

  8. xPC Target

    5  Pages

  9. SimMechanics

    7  Pages

  10. Simscape

    7  Pages

  11. Simulink

    6  Pages

  12. MATLAB®

    6  Pages

*Prices are pre-tax. They exclude delivery charges and customs duties and do not include additional charges for installation or activation options. Prices are indicative only and may vary by country, with changes to the cost of raw materials and exchange rates.