Stateflow | ![]() ![]() |
Imported Data
Similarly, you may want to access a data object that is externally (outside the Stateflow diagram, the machine, and the Simulink model) defined. By defining a data's scope to be Imported
, the data can be accessed anywhere within the hierarchy of that machine (including any offspring of the machine). An Imported
data object's parent is external. However, the data object needs an `adoptive' parent to resolve symbols for code generation. An Imported
data object's adoptive parent must be the machine because the machine is the (highest) level in the Stateflow hierarchy that can interface to external sources. It is the responsibility of the external source to make the Imported
data object available (in the manner appropriate to the source) .
If the external source is another machine, it must define the same data object to be Exported
. Stateflow generates the appropriate import and export data code for both machines.
This example shows the format required if the data is Imported from an external code source (custom code).
![]() | Exported Data | Exploring and Searching Charts | ![]() |