| Contents | Index |
This table summarizes what's new in V7.5 (R2010a):
| New Features and Changes | Version Compatibility Considerations | Fixed Bugs and Known Problems |
|---|---|---|
| Yes Details below | Yes—Details labeled as Compatibility Considerations, below. See also Summary. | Bug
Reports |
New features and changes introduced in this version are:
Support for Chart-Level Data with Fixed-Point Word Lengths Up to 128 Bits
New 'States When Enabling' Property for Charts with Function-Call Input Events
Enhanced Real-Time Workshop Code Generation for Noninlined State Functions
Enhanced Real-Time Workshop Code Generation for sizeof Function
Enhanced Real-Time Workshop Code Generation for Custom-Code Function Calls
Data Change Implicit Event No Longer Supports Machine-Parented Data
MEX Compilation with Microsoft Visual Studio .NET 2003 No Longer Supported
Code Generation Status Messages No Longer Shown in Command Window
Change in Behavior for Appearance of Optimization Parameters
You can now combine entry, during, and exit actions in a single line on state labels. This concise syntax provides enhanced readability for your chart and helps eliminate redundant code. For more information, see Combining State Actions to Eliminate Redundant Code in the Stateflow User's Guide.
A new diagnostic now detects unused Stateflow data and events during simulation. A warning message appears, alerting you to data and events that you can remove. This enhancement helps you reduce the size of your model by removing objects that have no effect on simulation.
This diagnostic checks for usage of Stateflow data, except for the following types:
Machine-parented data
Inputs and outputs of Embedded MATLAB functions
This diagnostic checks for usage of Stateflow events, except for the following type:
Input events
For more information, see Diagnostic for Detecting Unused Data and Diagnostic for Detecting Unused Events in the Stateflow User's Guide.
You can explicitly pass variable-size chart inputs and outputs as inputs and outputs of the following functions:
Embedded MATLAB functions
Simulink functions
Truth table functions that use Embedded MATLAB action language
For more information, see Using Variable-Size Data in Stateflow Charts in the Stateflow User's Guide.
Chart-level data now support up to 128 bits of fixed-point precision for the following scopes:
Input
Output
Parameter
Data Store Memory
This increase in maximum precision from 32 to 128 bits provides these enhancements:
Supports generating efficient code for targets with non-standard word sizes
Allows charts to work with large fixed-point signals
You can explicitly pass chart-level data with these fixed-point word lengths as inputs and outputs of the following functions:
Embedded MATLAB functions
Simulink functions
Truth table functions that use Embedded MATLAB action language
For more information, see Using Fixed-Point Data in Stateflow Charts in the Stateflow User's Guide.
The new chart property States When Enabling helps you specify how states behave when a function-call input event reenables a chart. You can select one of the following settings in the Chart properties dialog box:
Held — Maintain most recent values of the states.
Reset — Revert to the initial conditions of the states.
Inherit — Inherit this setting from the parent subsystem.
This enhancement helps you more accurately control the behavior of a chart with a function-call input event. For more information, see Controlling States When Function-Call Inputs Reenable Charts and Setting Properties for a Single Chart in the Stateflow User's Guide.
You can now define structures of parameter scope that are tunable. For more information, see Defining Structures of Parameter Scope in the Stateflow User's Guide.
If you prevent inlining for a state, Real-Time Workshop generated code contains a new static function inner_default_statename when:
Your chart contains a flow graph where an inner transition and default transition reach the same junction inside a state.
This flow graph is complex enough to exceed the inlining threshold.
For more information, see What Happens When You Prevent Inlining in the Stateflow User's Guide.
When you use the sizeof function in generated code to determine vector or matrix dimensions, sizeof always takes an input argument that evaluates to a data type.
| Behavior in Prior Releases | Behavior in R2010a | Benefits of Change in Code |
|---|---|---|
Input argument references the address of the variable, for example: sizeof(&a[0]) | Input argument evaluates to the data type of the variable, for example: sizeof(uint8_T [256]) | Ensures consistent results between simulation and code generation. |
When you use custom-code function calls in generated code, vector and matrix input arguments always use pass-by-reference instead of pass-by-value behavior.
| Behavior in Prior Releases | Behavior in R2010a | Benefits of Change in Code |
|---|---|---|
Custom-code function calls might use either pass-by-reference or pass-by-value. For pass-by-value, a memcpy operation creates and stores a temporary variable in the generated code, for example: int t[10];
for (i=0; i<10; i++) {
t[i] = y[i];
}
fcn(t); | Custom-code function calls use pass-by-reference, for example: fcn(&y[0]); |
|
The implicit event change(data_name) no longer works for machine-parented data. In R2010a, this implicit event works only with data at the chart level or lower in the hierarchy.
For machine-parented data, consider using change detection operators to determine when data values change. For more information, see Detecting Changes in Data Values in the Stateflow User's Guide.
Support for machine-parented events has been completely removed. In R2010a, an error message appears when you try to simulate models that contain events at the machine level.
To prevent undesired behavior for simulation and code generation, do not use machine-parented events. For simulation, broadcasting an event to all charts in your model causes the following to occur:
Charts wake up without regard to data dependencies.
Charts that are disabled might wake up.
Charts that use function-call or edge-triggered events wake up.
Charts unrelated to the event wake up.
Infinite recursive cycles can occur because the chart that broadcasts the event wakes up.
For code generation, machine-parented events prevent code reuse for the entire model.
Support for Microsoft Visual Studio® .NET 2003 as a MEX compiler for simulation has been removed because MATLAB and Simulink no longer support this compiler. For information about alternative compilers, see Choosing a Compiler in the Stateflow User's Guide.
For Windows platforms, messages about Stateflow or Embedded MATLAB code generation and compilation status now appear only on the status bar of the Simulink Model Editor when you update diagram. Previously, these messages also appeared in the MATLAB Command Window. This enhancement minimizes distracting messages at the command prompt.
Previously, the Configuration Parameters dialog box showed the Stateflow section of the Optimization pane only when both of the following conditions were true:
Real-Time Workshop and Stateflow licenses were available.
Your model included Stateflow charts or Embedded MATLAB Function blocks.
In R2010a, the Configuration Parameters dialog box shows the Stateflow section of the Optimization pane when both licenses are available. Your model need not include any Stateflow charts or Embedded MATLAB Function blocks.
For a list of optimization parameters, see Optimization Pane: General in the Simulink Graphical User Interface.
In R2010a, Real-Time Workshop Embedded Coder software inlines generated code for Stateflow charts, even if the generated code calls a subfunction that accesses global Simulink data. This optimization uses less RAM and ROM.
In existing models, simulation and code generation of Stateflow charts and Truth Table blocks always behave as if the Treat as atomic unit check box in the Subsystem Parameters dialog box is selected. Starting in R2010a, this check box is always selected for consistency with existing behavior.
The following demos have been added in R2010a:
| Demo... | Shows how you can... |
|---|---|
| sf_combined_state_actions | Combine entry and during actions in a single line on state labels |
| sf_variable_size_data | Pass variable-size data as an output of a Simulink function in a Stateflow chart |
| sf_multiword_fixpt | Pass multiword fixed-point data as an input and an output of a Simulink function in a Stateflow chart |
![]() | Version 7.6 (R2010b) Stateflow and Stateflow Coder Software | Version 7.4.1 (R2009bSP1) Stateflow and Stateflow Coder Software | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |