| Stateflow® | ![]() |
| On this page… |
|---|
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.
Note Stateflow blocks in libraries can inherit data properties. However, multiple instances of the same library in a model must inherit the same values for those properties. |
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:
Specify the signal type as real.
Specify a data type other than auto.
Minimize the use of automatic-mode properties.
To enforce writes before reads when unconnected blocks share global data in Stateflow charts, follow these guidelines:
Segregate reads into separate blocks from writes.
Assign priorities to blocks so that your model invokes write blocks before read blocks.
For instructions on how to set block execution order, see Controlling and Displaying the Sorted Order in the Simulink software documentation.
![]() | Resolving Data Properties from Simulink® Signal Objects | Transferring Data Across Models | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |