| Contents | Index |
This table summarizes what's new in V7.8 (R2011b):
| 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:
Control of Default Case Generation for Switch-Case Statements in Generated Code
Detection of State Inconsistency Errors at Compile Time Instead of Run Time
Ability to Model Persistent Output Data for Mealy and Moore Charts
Control of Diagnostic for Multiple Unconditional Transitions from One Source
MEX Compilation with Microsoft Windows SDK 7.1 Now Supported
Test Point Selection Moved to the Logging Tab in Properties Dialog Boxes
A new chart property, Saturate on integer overflow, enables you to control the behavior of data with signed integer types when overflow occurs. The check box appears in the Chart properties dialog box.
| Check Box | When to Use This Setting | Overflow Handling | Example of a Result |
|---|---|---|---|
| Selected | Overflow is possible for data in your chart and you want explicit saturation protection in the generated code. | Overflows saturate to either the minimum or maximum value that the data type can represent. | An overflow associated with a signed 8-bit integer saturates to –128 or +127. |
| Cleared | You want to optimize efficiency of the generated code. | The behavior depends on the C compiler you use for generating code. | The number 130 does not fit in a signed 8-bit integer and wraps to –126. |
Arithmetic operations for which you can enable saturation protection are:
Unary minus: –a
Binary operations: a + b, a – b, a * b, a / b, a ^ b
Assignment operations: a += b, a –= b, a *= b, a /= b
For new charts, this check box is selected by default. When you open charts saved in previous releases, the check box is cleared to maintain backward compatibility.
For more information, see Handling Integer Overflow for Chart Data in the Stateflow User's Guide.
A new Logging tab on the Data and State properties dialog boxes enables you to log signals in the same way that you do in Simulink. For more information, see Logging Data Values and State Activity in the Stateflow User's Guide.
You can specify whether or not to always generate default cases for switch-case statements. This optimization works on a per-model basis and applies to the code generated for a state that has multiple substates. Use the following check box on the Code Generation > Code Style pane of the Configuration Parameters dialog box:

| Check Box | When to Use This Setting | Format of Switch-Case Statements |
|---|---|---|
| Selected | Provide better code coverage by ensuring that every branch in the generated code is falsifiable. | Exclude the default case when it is unreachable. |
| Cleared | Ensure MISRA C® compliance and provide a fallback in case of RAM corruption. | Always include a default case. |
This readability optimization is available for embedded real-time (ERT) targets and requires a license for Embedded Coder™ software. For new models, this check box is cleared by default. When you open models saved in previous releases, the check box is also cleared to maintain backward compatibility.
For more information, see Code Generation Pane: Code Style in the Embedded Coder Reference documentation.
In R2011b, you can detect inconsistency errors earlier in the model development process. If you select Edit > Update Diagram in the Simulink Editor, you get an error when Stateflow statically detects that there are no active children during execution of a chart or a state.
In previous releases, static detection of these inconsistency errors did not occur until run time.
In previous releases, Mealy and Moore charts automatically applied the initial value of outputs every time the chart woke up. Both chart types ensured that outputs did not depend on previous values of outputs by enforcing the chart property Initialize Outputs Every Time Chart Wakes Up.
In R2011b, this restriction has been lifted. You can now choose whether or not to initialize outputs every time a Mealy or Moore chart wakes up. If you disable this chart property, you enable latching of outputs (carrying over output values computed in previous time steps). This enhancement enables you to model persistent output data for Mealy and Moore charts.
For more information, see Building Mealy and Moore Charts in the Stateflow User's Guide.
You can control the behavior of the Stateflow diagnostic that detects multiple unconditional transitions from the same state or the same junction. Set Transition shadowing to none, warning, or error on the Diagnostics > Stateflow pane of the Configuration Parameters dialog box.

For more information, see Diagnostics Pane: Stateflow in the Simulink Graphical User Interface documentation.
You can use Microsoft® Windows® Software Development Kit (SDK) 7.1 as a MEX compiler for simulation on 32- and 64-bit Windows machines. For a list of supported compilers, see Choosing a Compiler in the Stateflow User's Guide.
In R2011b, you can simulate models with Stateflow blocks when the current folder is a UNC path. In previous releases, simulation of those models required that the current folder not be a UNC path.
In R2011b, the Coverage tab of the Stateflow debugger has been removed. In previous releases, clicking the Coverage tab would show the following message:
Coverage feature obsoleted. Please use Simulink Verification and Validation in order to get complete coverage of Simulink/Stateflow objects.
The Test point check box has moved from the General tab to the Logging tab on State and Data properties dialog boxes.
![]() | Version 7.9 (R2012a) Stateflow Software | Version 7.7 (R2011a) Stateflow 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 |