Best Practices for Using Data in Stateflow® Charts

Avoid Inheriting Output Data Properties from Simulink® Blocks

Stateflow® output data should not inherit properties from output signals, because the values back propagate from Simulink® blocks and can be unpredictable.

In the Stateflow action language, inherited properties of outputs are determined solely by external information from Simulink models and not from the code. By contrast, within the Embedded MATLAB™ language subset — used in truth tables and Embedded MATLAB functions — inherited properties of outputs are determined solely from the code and the properties of the inputs.

Tips for Using Data Stores in Stateflow® Charts

When Binding to Data Stores in Stateflow® Charts

When you bind a Stateflow data object to a data store, the Stateflow object inherits all properties from the data store. To ensure that properties propagate correctly when you access data stores, follow these guidelines to create data stores:

When Enforcing Writes Before Reads in Unconnected Blocks

To enforce writes before reads when unconnected blocks share global data in Stateflow charts, follow these guidelines:

  


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