R12 Release Notes | ![]() ![]() |
New Features
This section introduces the new features and enhancements added in Stateflow 4.0 since Stateflow 2.0.
Note For information about closely-related products that extend Stateflow, see the section about the Stateflow Coder. |
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.
Temporal conditions allow your Stateflow model to express clearly and simply the time-dependent behavior of a system. See Temporal Logic Operators in the Stateflow User's Guide for more information.
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. See Working with Subcharts in the Stateflow User's Guide for more information.
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. See Working with Graphical Functions in the Stateflow User's Guide for more information.
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.
Command Toolbar
The Stateflow editor now contains a toolbar containing buttons for Stateflow's most commonly used editing and simulation commands. 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. See Setting Data Properties in the Stateflow User's Guide for more information.
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. See Transferring Object Properties in the Stateflow User's Guide for more information.
Library Link Helps
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.
Known Software and Documentation Problems
This section updates the Stateflow 4.0 documentation set, reflecting known Stateflow 4.0 software and documentation problems.
Many Open Windows Can Cause a Crash or Hang (Windows 95/98/Me)On Microsoft Windows 95/98/Me platforms, if you keep about 12 Stateflow windows open, Stateflow may crash or hang. Note that the actual number of open windows that may cause this problem depends on the resources currently in use by other components and applications.
Calling MATLAB Functions from Stateflow ChartsCalling MATLAB functions from Stateflow charts
using either the MATLAB namespace operator ml
,
or by using the function form ml()
with an argument whose datatype is not double
causes erroneous results.
The workaround is to cast the argument as a double
.
For example:
ml.myfun(x,y,1)
where x
and y
are Stateflow data items
whose data types are uint8
and int32
and the third argument is an integer has to be rewritten as
ml.myfun(double(x),double(y),double(1))
inserting casts around the non-double arguments.
![]() | Upgrading from an Earlier Release | Real-Time Workshop 4.0 Release Notes | ![]() |