Stateflow    

Building a Target

Building a target involves the following steps:

  1. Configure the target.
  1. See Configuring a Target for more information. You need to perform this step only if you are building a stand-alone or RTW target or are including custom code in the target. See Building Custom Code into the Target.

  1. Start the build process.
  1. Stateflow automatically builds or rebuilds simulation targets when you initiate simulation of the Stateflow machine. You must explicitly initiate the build process for other types of targets. See Configuring a Target for more information.

Configuring and building a target requires a basic understanding of how Stateflow builds targets, in the case of simulation and stand-alone targets, and how Real-Time Workshop builds targets, in the case of RTW targets. See How Stateflow Builds Targets for information on how Stateflow builds targets. Real-Time Workshop uses the same basic process for building Stateflow targets that it uses for building non-Stateflow targets. See the Real-Time Workshop documentation for information on how Real-Time Workshop builds targets.

Rebuilding a Target

You can rebuild a target at any time by repeating step 2. When rebuilding a target, Stateflow rebuilds only those parts corresponding to charts that have changed logically since the last build. When rebuilding a target, you need to perform step 1 only if you want to change the target's custom code or configuration.

Building Custom Code into the Target

You can configure the target build process to include custom C code supplied by you in the target (see Integrating Custom Code with Stateflow Diagrams). You use Stateflow or Real-Time Workshop to build an entire application that includes both the portions that you supply and the target code generated by Stateflow. You use Real-Time Workshop and Stateflow when you are building applications that include other types of Simulink blocks.


  Overview of Stateflow Targets How Stateflow Builds Targets