Products & Services Solutions Academia Support User Community Company

Learn more about Stateflow   

Version 7.2 (R2008b) Stateflow and Stateflow Coder Software

This table summarizes what's new in V7.2 (R2008b):

New Features and ChangesVersion Compatibility ConsiderationsFixed Bugs and Known ProblemsRelated Documentation at Web Site
Yes
Details below
Yes—Details labeled as Compatibility Considerations, below. See also Summary.

Bug Reports
Includes fixes

No

New features and changes introduced in this version are:

Support for Embedding Simulink Function-Call Subsystems in a Stateflow Chart

You can use a Simulink function to embed a function-call subsystem in a Stateflow chart. You fill this function with Simulink blocks and call it in state actions and on transitions. Like graphical functions, truth table functions, and Embedded MATLAB functions, you can use multiple return values with Simulink functions.

For more information, see Using Simulink Functions in Stateflow Charts in the Stateflow and Stateflow Coder User's Guide.

Support for Using Enumerated Data Types in a Stateflow Chart

You can use data of an enumerated type in a Stateflow chart.

For more information, see Using Enumerated Data in Stateflow Charts in the Stateflow and Stateflow Coder User's Guide and Using Enumerated Data in the Simulink User's Guide. For information on how enumerated data types appear in Real-Time Workshop generated code, see Enumerated Data Type Considerations in the Real-Time Workshop User's Guide.

New Alignment, Distribution, and Resizing Commands for Stateflow Charts

You can use alignment, distribution, and resizing commands on graphical chart objects, such as states, functions, and boxes.

For more information, see Formatting Chart Objects in the Stateflow and Stateflow Coder User's Guide.

Unified Simulation and Embeddable Code Generation Options for Stateflow Charts and Truth Table Blocks

You can use a single dialog box to specify simulation and embeddable code generation options that apply to Stateflow charts and Truth Table blocks. These changes apply:

Type of ModelSimulation OptionsEmbeddable Code Generation Options
Nonlibrary

Migrated from the Simulation Target dialog box to the Configuration Parameters dialog box

See GUI Changes in Simulation Options for Nonlibrary Models

Enhanced with new options in the Real-Time Workshop pane of the Configuration Parameters dialog box

See GUI Enhancements in Real-Time Workshop Code Generation Options for Nonlibrary Models

Library

Migrated from the Simulation Target dialog box to the Configuration Parameters dialog box

See GUI Changes in Simulation Options for Library Models

Migrated from the RTW Target dialog box to the Configuration Parameters dialog box

See GUI Changes in Real-Time Workshop Code Generation Options for Library Models

For more information, see Configuration Parameters Dialog Box in the Simulink Graphical User Interface and Building Targets in the Stateflow and Stateflow Coder User's Guide.

For compatibility information, see Compatibility Considerations.

GUI Changes in Simulation Options for Nonlibrary Models

The following sections describe changes in the panes of the Simulation Target dialog box for nonlibrary models.

Changes for the General Pane of the Simulation Target Dialog Box.  

ReleaseAppearance
Previous

General pane of the Simulation Target dialog box

New

Simulation Target pane of the Configuration Parameters dialog box

For details, see Nonlibrary Models: Mapping of GUI Options from the Simulation Target Dialog Box to the Configuration Parameters Dialog Box.

Changes for the Custom Code Pane of the Simulation Target Dialog Box.  

ReleaseAppearance
Previous

Custom Code pane of the Simulation Target dialog box

New

Simulation Target > Symbols pane of the Configuration Parameters dialog box

New

Simulation Target > Custom Code pane of the Configuration Parameters dialog box

For details, see Nonlibrary Models: Mapping of GUI Options from the Simulation Target Dialog Box to the Configuration Parameters Dialog Box.

Changes for the Description Pane of the Simulation Target Dialog Box.   In previous releases, the Description pane of the Simulation Target dialog box appeared as follows.

In R2008b, these options are no longer available. For older models where the Description pane contained information, the text is now accessible only in the Model Explorer. When you select Simulink Root > Configuration Preferences in the Model Hierarchy pane, the text appears in the Description field for that model.

Nonlibrary Models: Mapping of GUI Options from the Simulation Target Dialog Box to the Configuration Parameters Dialog Box.   For nonlibrary models, the following table maps each GUI option in the Simulation Target dialog box to the equivalent in the Configuration Parameters dialog box. The options are listed in order of appearance in the Simulation Target dialog box.

Old Option in the Simulation Target Dialog BoxNew Option in the Configuration Parameters Dialog BoxDefault Value of New Option
General > Enable debugging / animationSimulation Target > Enable debugging / animationon
General > Enable overflow detection (with debugging)Simulation Target > Enable overflow detection (with debugging)on
General > Echo expressions without semicolonsSimulation Target > Echo expressions without semicolonson
General > Build ActionsSimulation Target > Simulation target build modeIncremental build
NoneSimulation Target > Custom Code > Source file''
Custom Code > Include CodeSimulation Target > Custom Code > Header file''
Custom Code > Include PathsSimulation Target > Custom Code > Include directories''
Custom Code > Source FilesSimulation Target > Custom Code > Source files''
Custom Code > LibrariesSimulation Target > Custom Code > Libraries''
Custom Code > Initialization CodeSimulation Target > Custom Code > Initialize function''
Custom Code > Termination CodeSimulation Target > Custom Code > Terminate function''
Custom Code > Reserved NamesSimulation Target > Symbols > Reserved names{}
Custom Code > Use these custom code settings for all librariesNoneNot applicable
Description > Description

None

    Note   If you load an older model that contained user-specified text in the Description field, that text now appears in the Model Explorer. When you select Simulink Root > Configuration Preferences in the Model Hierarchy pane, the text appears in the Description field for that model.

Not applicable
Description > Document LinkNoneNot applicable

GUI Changes in Simulation Options for Library Models

The following sections describe changes in the panes of the Simulation Target dialog box for library models.

Changes for the General Pane of the Simulation Target Dialog Box.   In previous releases, the General pane of the Simulation Target dialog box for library models appeared as follows.

In R2008b, these options are no longer available. All library models inherit these option settings from the main model to which the libraries are linked.

Changes for the Custom Code Pane of the Simulation Target Dialog Box.  

ReleaseAppearance
Previous

Custom Code pane of the Simulation Target dialog box

New

Simulation Target pane of the Configuration Parameters dialog box

For details, see Library Models: Mapping of GUI Options from the Simulation Target Dialog Box to the Configuration Parameters Dialog Box.

Changes for the Description Pane of the Simulation Target Dialog Box.   In previous releases, the Description pane of the Simulation Target dialog box appeared as follows.

In R2008b, these options are no longer available. For older models where the Description pane contained information, the text is discarded.

Library Models: Mapping of GUI Options from the Simulation Target Dialog Box to the Configuration Parameters Dialog Box.   For library models, the following table maps each GUI option in the Simulation Target dialog box to the equivalent in the Configuration Parameters dialog box. The options are listed in order of appearance in the Simulation Target dialog box.

Old Option in the Simulation Target Dialog BoxNew Option in the Configuration Parameters Dialog BoxDefault Value of New Option
General > Enable debugging / animationNoneNot applicable
General > Enable overflow detection (with debugging)NoneNot applicable
General > Echo expressions without semicolonsNoneNot applicable
General > Build ActionsNoneNot applicable
NoneSimulation Target > Source file''
Custom Code > Include CodeSimulation Target > Header file''
Custom Code > Include PathsSimulation Target > Include directories''
Custom Code > Source FilesSimulation Target > Source files''
Custom Code > LibrariesSimulation Target > Libraries''
Custom Code > Initialization CodeSimulation Target > Initialize function''
Custom Code > Termination CodeSimulation Target > Terminate function''
Custom Code > Reserved NamesNoneNot applicable
Custom Code > Use local custom code settings (do not inherit from main model)Simulation Target > Use local custom code settings (do not inherit from main model)off
Description > DescriptionNoneNot applicable
Description > Document LinkNoneNot applicable

GUI Enhancements in Real-Time Workshop Code Generation Options for Nonlibrary Models

The following sections describe enhancements to the Real-Time Workshop pane of the Configuration Parameters dialog box for nonlibrary models.

Enhancement for the Real-Time Workshop: Symbols Pane of the Configuration Parameters Dialog Box.   In previous releases, the Real-Time Workshop > Symbols pane of the Configuration Parameters dialog box appeared as follows.

In R2008b, a new option is available in this pane: Reserved names. You can use this option to specify a set of keywords that the Real-Time Workshop build process should not use. This action prevents naming conflicts between functions and variables from external environments and identifiers in the generated code.

You can also choose to use the reserved names specified in the Simulation Target > Symbols pane to avoid entering the same information twice for the nonlibrary model. Select the Use the same reserved names as Simulation Target check box.

For more information, see Reserved names in the Real-Time Workshop Reference.

Enhancement for the Real-Time Workshop: Custom Code Pane of the Configuration Parameters Dialog Box.   In previous releases, the Real-Time Workshop > Custom Code pane of the Configuration Parameters dialog box appeared as follows.

In R2008b, a new option is available in this pane: Use the same custom code settings as Simulation Target. You can use this option to copy the custom code settings from the Simulation Target > Custom Code pane to avoid entering the same information twice for the nonlibrary model.

For more information, see Use the same custom code settings as Simulation Target in the Real-Time Workshop Reference.

GUI Changes in Real-Time Workshop Code Generation Options for Library Models

The following sections describe changes in the panes of the RTW Target dialog box for library models.

Changes for the General Pane of the RTW Target Dialog Box.   In previous releases, the General pane of the RTW Target dialog box for library models appeared as follows.

In R2008b, these options are no longer available. During Real-Time Workshop code generation, options specified for the main model are used.

Changes for the Custom Code Pane of the RTW Target Dialog Box.  

ReleaseAppearance
Previous

Custom Code pane of the RTW Target dialog box

New

Real-Time Workshop pane of the Configuration Parameters dialog box

For details, see Library Models: Mapping of GUI Options from the RTW Target Dialog Box to the Configuration Parameters Dialog Box.

Changes for the Description Pane of the RTW Target Dialog Box.   In previous releases, the Description pane of the RTW Target dialog box appeared as follows.

In R2008b, these options are no longer available. For older models where the Description pane contained information, the text is discarded.

Library Models: Mapping of GUI Options from the RTW Target Dialog Box to the Configuration Parameters Dialog Box.   For library models, the following table maps each GUI option in the RTW Target dialog box to the equivalent in the Configuration Parameters dialog box. The options are listed in order of appearance in the RTW Target dialog box.

Old Option in the RTW Target Dialog BoxNew Option in the Configuration Parameters Dialog BoxDefault Value of New Option
General > Comments in generated codeNoneNot applicable
General > Use bitsets for storing state configurationNoneNot applicable
General > Use bitsets for storing boolean dataNoneNot applicable
General > Compact nested if-else using logical AND/OR operatorsNoneNot applicable
General > Recognize if-elseif-else in nested if-else statementsNoneNot applicable
General > Replace constant expressions by a single constantNoneNot applicable
General > Minimize array reads using temporary variablesNoneNot applicable
General > Preserve symbol namesNoneNot applicable
General > Append symbol names with parent namesNoneNot applicable
General > Use chart names with no manglingNoneNot applicable
General > Build ActionsNoneNot applicable
NoneReal-Time Workshop > Source file''
Custom Code > Include CodeReal-Time Workshop > Header file''
Custom Code > Include PathsReal-Time Workshop > Include directories''
Custom Code > Source FilesReal-Time Workshop > Source files''
Custom Code > LibrariesReal-Time Workshop > Libraries''
Custom Code > Initialization CodeReal-Time Workshop > Initialize function''
Custom Code > Termination CodeReal-Time Workshop > Terminate function''
Custom Code > Reserved NamesNoneNot applicable
Custom Code > Use local custom code settings (do not inherit from main model)Real-Time Workshop > Use local custom code settings (do not inherit from main model)off
NoneReal-Time Workshop > Use the same custom code settings as Simulation Targetoff
Description > DescriptionNoneNot applicable
Description > Document LinkNoneNot applicable

Mapping of Target Object Properties to Parameters in the Configuration Parameters Dialog Box

Previously, you could programmatically set options for simulation and embeddable code generation by accessing the API properties of Target objects sfun and rtw, respectively. In R2008b, the API properties of Target objects sfun and rtw are replaced by parameters that you configure using the commands get_param and set_param.

For compatibility details, see Updating Scripts That Set Options Programmatically for Simulation and Embeddable Code Generation and What Happens When You Load an Older Model in R2008b.

Mapping of Object Properties to Simulation Parameters for Nonlibrary Models.   The following table maps API properties of the Target object sfun for nonlibrary models to the equivalent parameters in R2008b. Object properties are listed in alphabetical order; those not listed in the table do not have equivalent parameters in R2008b.

Old sfun Object PropertyOld Option in the Simulation Target Dialog BoxNew Configuration ParameterNew Option in the Configuration Parameters Dialog Box

CodeFlagsInfo
('debug')

General > Enable debugging / animation

SFSimEnableDebug

string - off, on

Simulation Target > Enable debugging / animation

CodeFlagsInfo
('overflow')

General > Enable overflow detection (with debugging)

SFSimOverflowDetection

string - off, on

Simulation Target > Enable overflow detection (with debugging)

CodeFlagsInfo
('echo')

General > Echo expressions without semicolons

SFSimEcho

string - off, on

Simulation Target > Echo expressions without semicolons
CustomCodeCustom Code > Include Code

SimCustomHeaderCode

string - ''

Simulation Target > Custom Code > Header file
CustomInitializerCustom Code > Initialization Code

SimCustomInitializer

string - ''

Simulation Target > Custom Code > Initialize function
CustomTerminatorCustom Code > Termination Code

SimCustomTerminator

string - ''

Simulation Target > Custom Code > Terminate function

ReservedNames

Custom Code > Reserved Names

SimReservedNameArray

string array - {}

Simulation Target > Symbols > Reserved names
UserIncludeDirsCustom Code > Include Paths

SimUserIncludeDirs

string - ''

Simulation Target > Custom Code > Include directories
UserLibrariesCustom Code > Libraries

SimUserLibraries

string - ''

Simulation Target > Custom Code > Libraries
UserSourcesCustom Code > Source Files

SimUserSources

string - ''

Simulation Target > Custom Code > Source files

Mapping of Object Properties to Simulation Parameters for Library Models.   The following table maps API properties of the Target object sfun for library models to the equivalent parameters in R2008b. Object properties are listed in alphabetical order; those not listed in the table do not have equivalent parameters in R2008b.

Old sfun Object PropertyOld Option in the Simulation Target Dialog BoxNew Configuration ParameterNew Option in the Configuration Parameters Dialog Box
CustomCodeCustom Code > Include Code

SimCustomHeaderCode

string - ''

Simulation Target > Header file
CustomInitializerCustom Code > Initialization Code

SimCustomInitializer

string - ''

Simulation Target > Initialize function
CustomTerminatorCustom Code > Termination Code

SimCustomTerminator

string - ''

Simulation Target > Terminate function

UseLocalCustomCodeSettings

Custom Code > Use local custom code settings (do not inherit from main model)

SimUseLocalCustomCode

string - off, on

Simulation Target > Use local custom code settings (do not inherit from main model)
UserIncludeDirsCustom Code > Include Paths

SimUserIncludeDirs

string - ''

Simulation Target > Include directories
UserLibrariesCustom Code > Libraries

SimUserLibraries

string - ''

Simulation Target > Libraries
UserSourcesCustom Code > Source Files

SimUserSources

string - ''

Simulation Target > Source files

Mapping of Object Properties to Code Generation Parameters for Library Models.   The following table maps API properties of the Target object rtw for library models to the equivalent parameters in R2008b. Object properties are listed in alphabetical order; those not listed in the table do not have equivalent parameters in R2008b.

Old rtw Object PropertyOld Option in the RTW Target Dialog BoxNew Configuration ParameterNew Option in the Configuration Parameters Dialog Box
CustomCodeCustom Code > Include Code

CustomHeaderCode

string - ''

Real-Time Workshop > Header file
CustomInitializerCustom Code > Initialization Code

CustomInitializer

string - ''

Real-Time Workshop > Initialize function
CustomTerminatorCustom Code > Termination Code

CustomTerminator

string - ''

Real-Time Workshop > Terminate function
UseLocalCustomCodeSettingsCustom Code > Use local custom code settings (do not inherit from main model)

RTWUseLocalCustomCode

string - off, on

Real-Time Workshop > Use local custom code settings (do not inherit from main model)
UserIncludeDirsCustom Code > Include Paths

CustomInclude

string - ''

Real-Time Workshop > Include directories
UserLibrariesCustom Code > Libraries

CustomLibrary

string - ''

Real-Time Workshop > Libraries
UserSourcesCustom Code > Source Files

CustomSource

string - ''

Real-Time Workshop > Source files

New Parameters in the Configuration Parameters Dialog Box for Simulation and Embeddable Code Generation

In R2008b, new parameters are added to the Configuration Parameters dialog box for simulation and embeddable code generation.

New Simulation Parameters for Nonlibrary Models.   The following table lists the new simulation parameters that apply to nonlibrary models.

New Configuration ParameterNew Option in the Configuration Parameters Dialog BoxDescription

SimBuildMode

string – sf_incremental_build, sf_nonincremental_build, sf_make, sf_make_clean, sf_make_clean_objects

Simulation Target > Simulation target build modeSpecifies how you build the simulation target for a model.

SimCustomSourceCode

string - ''

Simulation Target > Custom Code > Source fileEnter code lines to appear near the top of a generated source code file.

New Simulation Parameter for Library Models.   The following table lists the new simulation parameter that applies to library models.

New Configuration ParameterNew Option in the Configuration Parameters Dialog BoxDescription

SimCustomSourceCode

string - ''

Simulation Target > Source fileEnter code lines to appear near the top of a generated source code file.

New Code Generation Parameters for Nonlibrary Models.   The following table lists the new code generation parameters that apply to nonlibrary models.

New Configuration ParameterNew Option in the Configuration Parameters Dialog BoxDescription

ReservedNameArray

string array - {}

Real-Time Workshop > Symbols > Reserved namesEnter the names of variables or functions in the generated code that match the names of variables or functions specified in custom code.

RTWUseSimCustomCode

string – off, on

Real-Time Workshop > Custom Code > Use the same custom code settings as Simulation TargetSpecify whether to use the same custom code settings as those specified for simulation.

UseSimReservedNames

string – off, on

Real-Time Workshop > Symbols > Use the same reserved names as Simulation TargetSpecify whether to use the same reserved names as those specified for simulation.

New Code Generation Parameters for Library Models.   The following table lists the new code generation parameters that apply to library models.

New Configuration ParameterNew Option in the Configuration Parameters Dialog BoxDescription

CustomSourceCode

string''

Real-Time Workshop > Source fileEnter code lines to appear near the top of a generated source code file.

RTWUseSimCustomCode

string – off, on

Real-Time Workshop > Use the same custom code settings as Simulation TargetSpecify whether to use the same custom code settings as those specified for simulation.

Compatibility Considerations

Updating Scripts That Set Options Programmatically for Simulation and Embeddable Code Generation.   In previous releases, you could use the Stateflow API to set options for simulation and embeddable code generation by accessing the Target object (sfun or rtw) in a Stateflow machine. For example, you could set simulation options programmatically by running these commands in a MATLAB script:

r = slroot;
machine = r.find('-isa','Stateflow.Machine','Name','main_mdl');
t_sim = machine.find('-isa','Stateflow.Target','Name','sfun');
t_sim.setCodeFlag('debug',1);
t_sim.setCodeFlag('overflow',1);
t_sim.setCodeFlag('echo',1);
t_sim.getCodeFlag('debug');
t_sim.getCodeFlag('overflow');
t_sim.getCodeFlag('echo');

In R2008b, you must update your scripts to use the set_param and get_param commands to configure simulation and embeddable code generation. For example, you can update the previous script as follows:

cs = getActiveConfigSet(gcs);
set_param(cs,'SFSimEnableDebug','on');
set_param(cs,'SFSimOverflowDetection','on');
set_param(cs,'SFSimEcho','on');
get_param(cs,'SFSimEnableDebug');
get_param(cs,'SFSimOverflowDetection');
get_param(cs,'SFSimEcho');
For information about...See...

Object properties and their equivalent parameters in R2008b

Mapping of Target Object Properties to Parameters in the Configuration Parameters Dialog Box

Using the set_param and get_param commands

Using the Command-Line API to Set Parameters for Simulation and Embeddable Code Generation in the Stateflow and Stateflow Coder User's Guide

Accessing Target Options for Library Models.   In previous releases, you could access target options for library models via the Tools menu in the Stateflow Editor or the Contents pane of the Model Explorer. In R2008b, you must use the Tools menu to access target options for library models. For example, to specify parameters for the simulation target, select Tools > Open Simulation Target in the Stateflow Editor.

What Happens When You Load an Older Model in R2008b.   When you use R2008b to load a model created in an earlier version, dialog box options and the equivalent object properties for simulation and embeddable code generation targets migrate automatically to the Configuration Parameters dialog box, except in the cases that follow.

For the simulation target of a nonlibrary model, these options and properties do not migrate to the Configuration Parameters dialog box. The information is discarded when you load the model, unless otherwise noted.

Option in the Simulation Target Dialog Box of a Nonlibrary ModelEquivalent Object Property
Custom Code > Use these custom code settings for all librariesApplyToAllLibs
Description > DescriptionDescription

    Note   If you load an older model that contains user-specified text in the Description field, that text now appears in the Model Explorer. When you select Simulink Root > Configuration Preferences in the Model Hierarchy pane, the text appears in the Description field for that model.

Description > Document LinkDocument

For the simulation target of a library model, these options and properties do not migrate to the Configuration Parameters dialog box. The information is discarded when you load the model.

Option in the Simulation Target Dialog Box of a Library ModelEquivalent Object Property
General > Enable debugging / animationCodeFlagsInfo('debug')
General > Enable overflow detection (with debugging)CodeFlagsInfo('overflow')
General > Echo expressions without semicolonsCodeFlagsInfo('echo')
General > Build ActionsNone
Custom Code > Reserved NamesReservedNames
Description > DescriptionDescription
Description > Document LinkDocument

For the embeddable code generation target of a library model, these options and properties do not migrate to the Configuration Parameters dialog box. The information is discarded when you load the model.

Option in the RTW Target Dialog Box of a Library ModelEquivalent Object Property
General > Comments in generated codeCodeFlagsInfo('comments')
General > Use bitsets for storing state configurationCodeFlagsInfo('statebitsets')
General > Use bitsets for storing boolean dataCodeFlagsInfo('databitsets')
General > Compact nested if-else using logical AND/OR operatorsCodeFlagsInfo('emitlogicalops')
General > Recognize if-elseif-else in nested if-else statementsCodeFlagsInfo('elseifdetection')
General > Replace constant expressions by a single constantCodeFlagsInfo('constantfolding')
General > Minimize array reads using temporary variablesCodeFlagsInfo('redundantloadelimination')
General > Preserve symbol namesCodeFlagsInfo('preservenames')
General > Append symbol names with parent namesCodeFlagsInfo('preservenameswithparent')
General > Use chart names with no manglingCodeFlagsInfo('exportcharts')
General > Build ActionsNone
Custom Code > Reserved NamesReservedNames
Description > DescriptionDescription
Description > Document LinkDocument

What Happens When You Save an Older Model in R2008b.   When you use R2008b to save a model created in an earlier version, parameters for simulation and embeddable code generation from the Configuration Parameters dialog box are saved. However, properties of API Target objects sfun and rtw are not saved if those properties do not have an equivalent parameter in the Configuration Parameters dialog box (see What Happens When You Load an Older Model in R2008b). Properties that do not migrate to the Configuration Parameters dialog box are discarded when you load the model. Therefore, old Target object properties are not saved even if you choose to save the model as an older version (for example, R2007a).

Workaround for Library Models If They No Longer Use Local Custom Code Settings.  

Behavior in R2008a and Earlier Releases

In R2008a and earlier releases, the main model simulation target had a custom code option Use these custom code settings for all libraries, or the target property ApplyToAllLibs. The library model simulation target had a similar custom code option Use local custom code settings (do not inherit from main model), or the target property UseLocalCustomCodeSettings.

The following criteria determined which custom code settings would apply to the library model:

If ApplyToAllLibs for the main model is...And UseLocalCustomCodeSettings for the library model is...Then the library model uses...
TrueFalseMain model custom code
TrueTrueLocal custom code
False TrueLocal custom code
False False Local custom code (by default, but ambiguous)

The last case was ambiguous, because the main model did not propagate custom code settings and the library model did not specify use of local custom code settings either. In this case, the default behavior was to use local custom code settings for the library model.

Behavior in R2008b

In R2008b, the Use these custom code settings for all libraries option for the main model is removed. The library model either picks up its local custom code settings if specified to do so, or uses the main model custom code settings when the Use local custom code settings option is not selected. This change introduces backward incompatibility for older models that use the "False (main model), False (library model)" setup for specifying custom code settings.

Workaround to Prevent Backward Incompatibility

To resolve the ambiguity in older models, you must explicitly select Use local custom code settings for the library model when you want the local custom code settings to apply:

  1. Open the Stateflow simulation target for the library model.

    1. Load the library model and unlock it.

    2. Open one of the library charts in the Stateflow Editor.

    3. Select Tools > Open Simulation Target.

  2. In the dialog box that appears, select Use local custom code settings (do not inherit from main model).

New Pattern Wizard for Consistent Creation of Logic Patterns and Iterative Loops

You can use the Stateflow Pattern Wizard to create commonly used flow graphs such as for-loops in a quick and consistent manner.

For more information, see Modeling Logic Patterns and Iterative Loops Using Flow Graphs in the Stateflow and Stateflow Coder User's Guide.

Support for Initializing Vectors and Matrices in the Data Properties Dialog Box

In the Data properties dialog box, you can initialize vectors and matrices in the Initial value field of the Value Attributes pane.

For more information, see How to Define Vectors and Matrices in the Stateflow and Stateflow Coder User's Guide.

Change in Default Mode for Ordering Parallel States and Outgoing Transitions

The default mode for ordering parallel states and outgoing transitions is now explicit. When you create a new chart, you define ordering explicitly in the Stateflow Editor. However, if you load a chart that uses implicit ordering, that mode is retained until you switch to explicit ordering.

For more information, see Execution Order for Parallel States and Evaluation Order for Outgoing Transitions in the Stateflow and Stateflow Coder User's Guide.

Optimized Inlining of Code Generated for Stateflow Charts

In R2008b, Real-Time Workshop code generation is enhanced to enable optimized inlining of code generated for Stateflow charts.

More Efficient Parsing for Nonlibrary Models

When you parse a nonlibrary model, library charts that are not linked to this model are ignored. This enhancement enables more efficient parsing for nonlibrary models.

Change in Casting Behavior When Calling MATLAB Functions in a Chart

When you call MATLAB functions in a Stateflow chart, scalar inputs are no longer cast automatically to data of type double. This behavior applies when you use the ml operator to call a built-in or custom MATLAB function. (For details, see ml Namespace Operator in the Stateflow and Stateflow Coder User's Guide.)

Compatibility Considerations

Previously, Stateflow generated code for simulation would automatically cast scalar inputs to data of type double when calling MATLAB functions in a chart. This behavior has changed. Stateflow charts created in earlier versions now generate errors during simulation if they contain calls to external MATLAB functions that expect scalar inputs of type double, but the inputs are of a different data type.

To prevent these errors, you can change the data type of a scalar input to double or add an explicit cast to type double in the function call. For example, you can change a function call from ml.function_name(i) to ml.function_name(double(i)).

Use of Output Data with Change Detection Operators Disallowed for Initialize-Outputs-at-Wakeup Mode

If you enable the option Initialize Outputs Every Time Chart Wakes Up in the Chart properties dialog box, do not use output data as the first argument of a change detection operator. When this option is enabled, the change detection operator returns false if the first argument is an output data. In this case, there is no reason to perform change detection. (For details, see Using Change Detection in Actions in the Stateflow and Stateflow Coder User's Guide.)

Compatibility Considerations

Previously, Stateflow software would allow the use of output data with change detection operators when you enable the option Initialize Outputs Every Time Chart Wakes Up. This behavior has changed. Stateflow charts created in earlier versions now generate errors during parsing to prevent such behavior.

Parsing a Stateflow Chart Without Simulation No Longer Detects Unresolved Symbol Errors

To detect unresolved symbol errors in a chart, you must start simulation or update the model diagram. When you parse a chart without simulation or diagram updates, the Stateflow parser does not have access to all the information needed to check for unresolved symbols, such as exported graphical functions from other charts and enumerated data types. Therefore, the parser now skips unresolved symbol detection to avoid generating false error messages. However, if you start simulation or update the model diagram, you invoke the model compilation process, which has full access to the information needed, and unresolved symbols are flagged.

For more information, see Parsing Stateflow Charts and Resolving Symbols in the Stateflow and Stateflow Coder User's Guide.

Generation of a Unique Name for a Copied State Limited to States Without Default Labels

If you copy and paste a state in the Stateflow Editor, a unique name is generated for the new state only if the original state does not use the default ? label. For more information, see Copying Graphical Objects in the Stateflow and Stateflow Coder User's Guide.

New Configuration Set Created When Loading Nonlibrary Models with an Active Configuration Reference

When you load a nonlibrary model with an active configuration reference for Stateflow charts or Truth Table blocks, a copy of the referenced configuration set is created and attached to your model. The new configuration set is marked active, and the configuration reference is marked inactive. This behavior does not apply to library models.

For information about using configuration references, see Referencing Configuration Sets in the Simulink User's Guide.

Compatibility Considerations

In previous releases, you could load a nonlibrary model with an active configuration reference for Stateflow charts or Truth Table blocks. In R2008b, the configuration reference becomes inactive after you load the model, and a warning message appears to explain this change in behavior. To restore the configuration reference to its original active state, follow the instructions in the warning message.

For more information, see Configuration References for Models with Older Simulation Target Settings in the Simulink User's Guide.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS