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

5 visualizaciones (últimos 30 días)
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?

Respuestas (1)

Patel Mounika
Patel Mounika el 1 de Abr. de 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.

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by