Stateflow    

Exported Data

You may want an external source (outside the Stateflow diagram, the machine, and the Simulink model) to be able to access a data object. By defining a data object's scope to be Exported, that data is made accessible to external sources. Exported data must be parented by the machine because the machine is the (highest) level in the Stateflow hierarchy that can interface to external sources. The machine also retains the ability to access the Exported data object. Exporting the data object does not imply anything about what the external source does with the data. It is the responsibility of the external source to include the Exported data object (in the manner appropriate to the source) to make use of the right to access the data.

If the external source is another machine, then one machine defines an Exported data object and the other machine defines the same data object to be Imported. Stateflow generates the appropriate export and import data code for both machines.

This example shows the format required in the external code source (custom code) to import an Exported data object.


 Imported Events Imported Data