| Stateflow User's Guide | ![]() |
Adding a Stateflow Target
You need to specify information for generating code and building Stateflow charts into the RTW target for the model. For nonlibrary models, you specify this information directly for the RTW target in the Configuration Parameters dialog. For library models you specify this information in a Stateflow RTW target. Later, when you build the RTW target for the model, this information is handed off to the model target and resolved there.
You also need a Stateflow target when you want to use the generated code for the Stateflow blocks in a model for your own use. You collect the generated code from the Stateflow blocks in a model with a Stateflow custom target.
When you create a Simulink model, a Stateflow simulation target named sfun is added to it by default. By default, Stateflow RTW and custom targets are not created with the model. You need to add them to the model. You create an RTW target when you add a target with the name rtw to the Simulink model. You create a custom target when you add a target with a name other than sfun or rtw to the Simulink model.
To create a Stateflow RTW target for a library model, or a custom target for any model, do the following:
rtw.
sfun or rtw.
The targets you add are displayed in the Model Explorer as members of the model object, as shown.
You can also create Stateflow RTW and custom targets in the Model Explorer by selecting Stateflow Target from the Add menu. See Adding a Target in the Model Explorer for details.
| How Does Stateflow Build into Targets? | Configuring a Simulation Target for Stateflow | ![]() |
© 1994-2005 The MathWorks, Inc.