xPC Target    

Marking Block Parameters

Tagging parameters in your Simulink model allows the function xpcsliface to create To xPC Target interface blocks. These interface blocks contain the parameters you connect to control devices (dials) in your user interface model.

After you create a Simulink model, you can mark the block parameters. This procedure uses the model xpc_tank1.mdl (or xpctank.mdl) as an example. See Creating a Target Application Model.

  1. Open a Simulink model. For example, in the MATLAB Command Window, type
  2. Point to a Simulink block, and then right-click.
  3. From the menu, click Block Properties. Do not click Block Parameters.

  1. A Block properties dialog box opens.

  1. In the Description box, enter a tag to the parameters for this block.
  1. For example, the Setpoint block is a constant with a single parameter that selects the level of water in the tank. Enter the tag shown below.

    The tag has the following format:

    For single dimension ports, the following syntax is also valid:

    index_n -- Index of a block parameter. Begin numbering parameters with an index of 1.

    label_n -- Name for a block parameter that will be connected to a To xPC Target block in the user interface model. Separate the labels with a space, not a comma.

  1. Repeat steps 1 through 3 for the remaining parameters you want to tag.
  1. For example, for the Controller block, enter the tag

    For the Pump Switch and Drain Valve blocks, enter the tags

    To create the To xPC blocks in an user interface model for a block with four properties, use the following syntax:

    To create the To xPC blocks for the second and fourth properties in a block with at least four properties, use the following syntax:

  1. From the File menu, click Save as. Enter a file name for your model. For example, enter

You next task is to mark block signals if you have not already done so, and then create the user interface template model. See Marking Block Signals and Creating a User Interface Model.


  Creating a Target Application Model Marking Block Signals