Stateflow    

Configuring a Target

Configuring a target entails some or all of the following steps:

  1. Add the target, if necessary, to the state machine's target list.

    See Adding a Target to a State Machine's Target List for instructions on how to add targets to a state machine's target list.

  1. Specify code generation options.

    See Specifying Code Generation Options for more information.

  1. Specify custom code options.

    See Specifying Custom Code Options for more information.

  1. Check "Apply to all Libraries" on the Target Builder dialog box if you want the selected options to apply to the code generated for charts imported from chart libraries.

Configuring an RTW target may require additional steps. See the Real-Time Workshop User's Guide for more information.

Adding a Target to a State Machine's Target List

Building an Real-Time Workshop target requires that you first add the target to the list of potential targets maintained by Stateflow for a particular model.

To add a target:

  1. Select Explore from the Stateflow editor's Tools menu.

    The Stateflow Explorer appears.

    The Explorer object hierarchy shows the state machines currently loaded in memory.

  1. Select the state machine to which you want to add the Real-Time Workshop target.

    The Explorer displays the selected state machine's data, events, and targets in the contents pane.

  1. Select Target from the Explorer's Add menu to add a target with the default name "untitled" to the selected machine.
  2. Rename the target.

    You must name the target rtw. (A state machine can have only one Real-Time Workshop target.)

Renaming the Target

To rename the target:

  1. Select the target in the Explorer's content pane and press the right mouse button.

    A pop-up menu appears.

  1. Select Rename from the pop-up menu.

    The Explorer redisplays the selected target's name in an edit box.

  1. Change the target's name in the edit box.
  2. Click outside the edit box to close it.

 Starting from a Target Builder Dialog Box Specifying Code Generation Options