Best Practices for Using Data in 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.

Restrict use of machine-parented data

Avoid using machine-parented data. The presence of machine-parented data in a model prevents reuse of generated code and other code optimizations. This type of data is also incompatible with many Simulink and Stateflow features.

For example, the following features do not support machine-parented data:

  • Enumerated data

  • Simulink functions

  • Chart SimState

  • Implicit change events

  • Detection of unused data

  • Model referencing (see Model Referencing Limitations (Simulink) )

  • Analysis by Simulink Design Verifier™ software

  • Code generation by Simulink PLC Coder™ software

  • Parameters binding to a Simulink.Parameter object in the base workspace

To make Stateflow data accessible to other charts and blocks in a model, use data store memory. For details, see Access Data Store Memory from a Chart.

Related Topics

Was this topic helpful?