Stateflow storage class - how to make it globalexternal storage class instead of auto?

2 vues (au cours des 30 derniers jours)
The variables in my stateflow model have the auto storage class, and on code generation they are generated as part of a structure (TEST_DWork) Is there a way to set stateflow variables to be of the ExportedGlobal storage class so they end up as global variables in code generation?

Réponses (1)

Patel Mounika
Patel Mounika le 1 Avr 2019
Simulink implements global variables either as Data Store Memory blocks or Simulink.signal objects.
  • Verify that your models do not contain any Data Store Memory blocks.
  • In the MATLAB® base workspace, create a Simulink.Signal object with these attributes:
-Set Data type to an explicit data type. The data type cannot be Auto.
-Fully specify Dimensions. The signal dimensions cannot be –1 or Inherited.
-Fully specify Complexity. The complexity cannot be Auto.
-Set Storage class to ExportedGlobal.
  • In each chart that shares the data, bind a Stateflow data object to the Simulink data store.
Refer to below link for more understanding.

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by