| Stateflow User's Guide | ![]() |
Importing Data from External Stateflow Code
A Stateflow machine can import definitions of data defined by external code that embeds the Stateflow machine. Importing externally defined data enables a Stateflow machine to access data defined by the system in which it is embedded.
To import externally defined data into the Stateflow machine, do the following:
Imported.
| Note You can add imported data to the Stateflow machine only in the Model Explorer, by adding it to a Simulink model. |
For each imported item, the Stateflow code generator assumes that external code provides a prototype of the form
where type is the C data type corresponding to the Stateflow data type of the imported item (for example, int for Integer, double for Double, and so on) and data is the item's Stateflow name. For example, suppose that your Stateflow machine defines an imported int32 integer named counter. The Stateflow code generator expects the item to be defined in the external C code as
See Imported Data for an example of Stateflow external code data imported into Stateflow.
| Exporting Data to External Stateflow Code | Typing Stateflow Data | ![]() |
© 1994-2005 The MathWorks, Inc.