Stateflow and Stateflow Coder Release Notes | ![]() ![]() |
New Features
New features for Stateflow 5.0 and Stateflow Coder 5.0 are as follows:
If you are upgrading from a release earlier than Release 12.1, then you should see New Features.
Any Chart or Library Chart can Export a Function
Any chart or library chart can now export a graphical function and any other chart or library chart can call it as long as they are both (the caller and the called) accessible through the same main model.
This feature is introduced in Stateflow 5.0 and is fully documented in Exporting Graphical Functions" in the Stateflow User's Guide.
Print Details... Report Available in Stateflow
The "Print Details..." report available in Simulink is also available in Stateflow for making comprehensive reports of Stateflow objects only. Make this report in the Stateflow diagram editor by selecting Print details... from the File menu. From the resulting window, you can choose one of the following report options:
Current -- Reports on the chart or subchart in the current Stateflow diagram editor.
Current and below -- Reports on the chart or subchart in the current Stateflow diagram editor and all contents at lower levels of containment.
Print all objects -- Reports on all objects in the current Stateflow chart.
This feature is introduced in Stateflow 5.0.
Fixed-Point Data
Stateflow now supports fixed-point data with the following features:
:=
assignment operator
This feature is introduced in Stateflow 5.0 and is documented in Fixed-Point Data Types in the Stateflow User's Guide.
Array and Matrix Support for matlab Namespace Operator and Function Call
Stateflow now supports vector arrays and n-dimensional matrices as arguments and return values for the matlab
(ml
for short) namespace operator and matlab
(ml
for short) function call. Before, only scalar data was supported.
This feature is introduced in Version 5.0 and is fully documented in MATLAB Functions and Variables in the Stateflow User's Guide.
matlab Data Type
Stateflow supports a new data type called matlab
. Data of this type is typed internally with the MATLAB type mxArray
. This means that you can assign (store) any type of data available in Stateflow to a data of type matlab
. This includes any type of data defined in Stateflow or returned from MATLAB with the ml
namespace operator or ml
function.
This feature is introduced in Version 5.0 and is documented in the topic matlab Data Type in the Stateflow User's Guide.
Matrix Support for Data to and from Simulink
Stateflow now supports two-dimensional matrices of any type for data with the scope Data input from Simulink or Data output to Simulink.
This feature is introduced in Version 5.0 and is documented in Defining Input Data and Defining Output Data" in the Stateflow User's Guide.
Stateflow Allows up to 254 Events
Stateflow now handles up to 254 events per chart. The previous maximum was 127. Stateflow now throws an error if your chart has more than 254 events.
This feature is introduced in Version 5.0.
Undo and Redo in the Stateflow Diagram Editor
You can undo and redo operations you perform in the Stateflow diagram editor. When you undo an operation in the Stateflow diagram editor, you reverse the last edit operation you performed. After you undo operations in the diagram editor, you can also redo them one-at-a-time. When you place your mouse cursor over the Undo or Redo buttons, the tooltip that appears indicates the nature of the operation to undo or redo.
This feature is introduced in Version 5.0 and is documented in "Undoing and Redoing Editor Operations" in the Stateflow User's Guide.
The Stateflow API
The new Stateflow API provides a programmatic access to Stateflow. Through individual MATLAB commands or scripts of commands, you can manipulate Stateflow objects (machines, charts, states, boxes, functions, notes, transitions, junctions, data, events, and targets) to perform actions previously only available through the Stateflow graphical interfaces. This includes constructing new diagrams from scratch and modifying existing ones.
This feature was introduced in Version 4.2 and is fully documented in API User's Guide in the Stateflow User's Guide.
The Stateflow API provides control for the following Stateflow actions:
User Comments Included in Generated Code
Stateflow includes user comments you enter on Stateflow diagrams in generated code.
This feature was introduced in Version 4.2.
For Loops Emitted in Generated Code
The Stateflow Code generator detects and emits for loops when applicable. In previous versions, Stateflow always emitted while loops.
This feature was introduced in Version 4.2.
Enhanced Stateflow Integration with Real-Time Workshop
The code generated for Stateflow blocks is seamlessly integrated with Simulink, leading to more efficient readable code.
This feature was introduced in Version 4.2.
Stateflow Explorer Remembers its Position and Size
Stateflow Explorer now remembers its position and size across sessions with Stateflow.
This feature was introduced in the Web-downloadable Version 4.1.1.
Trailing `F' Specifier for Single Precision Floating Point Numbers
Stateflow action language now recognizes a trailing "F" for specifying single precision floating-point numbers as in the action statement x = 4.56F;
. In Stateflow action language, if a trailing "F" does not appear with a number, it is assumed to be double precision. Specifying single precision numbers allows you to save memory in generated code.
This feature was introduced in the Web-downloadable Version 4.1.1.
Graphical Function Inlining In Generated Code
Graphical functions with IO can now be inlined in the generated code. You can specify inlining behavior (auto, force inline, force no inline) for every graphical function via its property dialog box. "auto" refers to a default strategy in which Stateflow Coder itself decides when it is advantageous to inline a graphical function.
This feature was introduced in Version 4.1.1.
Stateflow-RTW Code Generation Improvements
When possible, Simulink input and output data to a Stateflow chart are made local, reducing RAM size. Whenever possible, these local inputs are conditionally evaluated (via "expression folding") resulting in execution speed improvements.
This feature was introduced in Version 4.1.1.
Unnecessary Data Initialization Removed
Unnecessary data initialization statements are now removed from the code generated for graphical functions.
This feature was introduced in Version 4.1.1.
Simple If Statements Optimized
A simple boolean expression evaluation scheme is used to optimize if
statements such as if(1)
, if(0)
, if(ON==OFF)
, etc.
This feature was introduced in Version 4.1.1.
![]() | Stateflow and Stateflow Coder Release Notes | Major Bug Fixes | ![]() |