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 also see New Features.
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 in the Stateflow documentation.
Undo Operation 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 and Stateflow online help.
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.
The Stateflow API provides control for the following Stateflow actions:
This feature was introduced in Version 4.2 and is documented in API User's Guide in the Stateflow documentation.
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 documentation.
New Model Report Available in Stateflow
A new model report is available in Stateflow (also in Simulink) for making comprehensive reports of Stateflow objects. Make this report in the Stateflow diagram editor by selecting Print Details... from the File menu.
This feature is introduced in Stateflow 5.0 and is documented in Generating a Model Report in Stateflow in the Stateflow documentation.
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 documented in Exporting Graphical Functions in the Stateflow documentation.
ml Data Type
Stateflow supports a new data type called ml
. 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 ml
. 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 ml Data Type in the Stateflow documentation.
Array and Matrix Support for ml 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 documented in MATLAB Functions and Variables in the Stateflow documentation.
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 and is documented in Adding Events to the Data Dictionary in the Stateflow documentation.
User Comments Included in Generated Code
Stateflow has the option for including comments you enter in the action language of Stateflow diagrams in generated code for rtw and custom targets. This option is enabled by default.
This feature was introduced in Version 4.2 and is documented in Specifying Code Generation Options in the Stateflow documentation.
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 and 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 and is documented in Special Symbols in the Stateflow documentation.
Graphical Function Inlining In Generated Code
Graphical functions with I/O 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 and is documented in Specifying Graphical Function Properties in the Stateflow documentation.
Stateflow 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 |