Stateflow and Stateflow Coder Release Notes    

Chapter 3
Stateflow 4.0 and Stateflow Coder 4.0 Release Notes


New Features

This section introduces the new features and enhancements added in Stateflow 4.0 and Stateflow Coder 4.0 since Stateflow 2.0 and Stateflow Coder 2.0.

Stateflow 4.0 New Features

Stateflow Works with MATLAB Release 12

Stateflow 4.0 upgrades all features introduced in Stateflow 3.0 to work with Release 12 of the MATLAB product family.

Temporal Logic

You can now use temporal conditions (before, after, at, every time) to determine the activation of transitions and duration of state activation. Temporal logic provides a simple paradigm for event scheduling and allows your Stateflow model to express clearly and simply the time-dependent behavior of a system.

This feature is fully documented in Temporal Logic Operators in the Stateflow documentation and Stateflow online help.

Subcharts

Stateflow now allows you to create charts within charts. A chart that is embedded in another chart is called a subchart. A subchart can contain anything a top-level chart can, including other subcharts. In fact, you can nest subcharts to any level. A subchart appears as a labeled block in the chart that contains it. You can create transitions among objects residing in different subcharts existing at the same level or at different levels. A transition that crosses subchart boundaries in this fashion is called a supertransition.

Subcharts enable you to reduce a complex chart to a set of simpler, hierarchically organized diagrams. This makes the chart easier to understand and maintain, without changing the semantics of the chart in any way.

Stateflow ignores subchart boundaries when simulating and generating code from Stateflow models.

This feature is fully documented in Working with Subcharts in the Stateflow documentation and Stateflow online help.

Graphical Functions

A graphical function is a function defined by a flow graph. Graphical functions are similar to textual functions, such as MATLAB and C functions. Like textual functions, graphical functions can accept arguments and return results. You invoke graphical functions in transition and state actions in the same way you invoke MATLAB and C functions. Unlike C and MATLAB functions, however, graphical functions are full-fledged Stateflow objects. You use the Stateflow editor to create them and they reside in your Stateflow model along with the diagrams that invoke them. This makes graphical functions easier to create, access, and manage than textual functions, whose creation requires external tools and whose definitions reside separately from the model.

This feature is fully documented in Creating a Graphical Function in the Stateflow documentation and Stateflow online help.

Symbol Autocreation Wizard

The Symbol Autocreation Wizard helps you to add missing data and events to your Stateflow charts. When you parse the diagram or run the simulation, this wizard detects whenever data and events have not been previously defined in the Stateflow Explorer. The wizard then opens automatically and heuristically recommends attributes for the unresolved data or events to help you to quickly define these symbols.

This feature is fully documented in Symbol Autocreation Wizard" in the Stateflow documentation and Stateflow online help.

Command Toolbar

The Stateflow editor now contains a toolbar containing buttons for the most commonly used editing and simulation commands in Stateflow. The toolbar saves searching through menus for these commands.

Navigation Toolbar

This toolbar contains buttons for navigating a chart hierarchy.

Straight Line Transitions

You can now create straight lines between junctions. Transitions that are almost straight are automatically snapped straight during edit time. The snap-to-grid functionality helps align connected junctions vertically and horizontally.

Workspace-Based Data

Data items can now be initialized from identically named variables in the MATLAB workspace and/or copied back to the workspace at the end of a simulation. Workspace-initialized constants consume no memory in generated code.

This feature is fully documented in Setting Data Properties" in the Stateflow documentation and Stateflow online help.

Explorer Copy Properties

Stateflow Explorer now allows you to pick up properties from one data/event/target item and apply them to another data/event/target item or a group of items. This speeds up the process of creating diagrams that have objects with similar sets of properties.

This feature is fully documented in Transferring Object Properties in the Stateflow documentation and Stateflow online help.

Library Link Icons

An arrow distinguishes icons of library links from those of actual charts in the Stateflow Explorer. Clicking a library link icon opens the library chart in the Stateflow Editor. Stateflow 4.0 requires Release 12, including Simulink 4.0.

Stateflow Coder 4.1 New Features

Improved Code Generation

The Stateflow Coder 4.0 code generation has been significantly improved:

Temporal Logic

You can now use temporal conditions (before, after, at, every time) to determine the activation of transitions and duration of state activation. Temporal logic provides a simple paradigm for event scheduling.

Temporal conditions allow your Stateflow model to express clearly and simply the time-dependent behavior of a system.

Stateflow Coder 4.0 supports the new temporal logic feature in Stateflow, which allows it to be extremely efficient with memory usage in the generated code. When you use temporal operators, Stateflow manages the various counters needed for event scheduling. Then, with behind-the-scenes optimizations, Stateflow Coder 4.0 can allocate memory more economically.


  Warning on Loading Models from Previous Stateflow Versions Upgrading from an Earlier Release