Stateflow | ![]() ![]() |
Exported Data
You might want an external source (outside the Stateflow diagram, its Stateflow machine, and itse Simulink model) to be able to access a data object. By defining a data object's scope as Exported, you make it accessible to external sources. Exported data must be parented by the Stateflow machine, because the machine has the highest level in the Stateflow hierarchy and can interface to external sources. The Stateflow 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 Stateflow machine, then that machine defines an exported data object and the other machine defines the same data object as imported. Stateflow generates the appropriate export and import data code for both machines.
Exported Data Example
The following example shows the format required in the external code source (custom code) to import a Stateflow exported data object:
![]() | Imported Events | Imported Data | ![]() |