Promote Parameter to Mask

Blocks and subsystems can have multiple parameters associated with them. Block masks allow you to expose one or more of these parameters while hiding others from view. Promoting specific parameters to the mask block simplifies the interface and enables you to specify the parameters the user of the block can view and set.

You can use the Promote button on the Mask Editor to promote any underlying parameter of a block either to a block mask or to a subsystem mask. The promoted block parameter gets associated with a parameter in the mask, enabling you to edit the parameter value from the mask dialog box.

Promote parameters from the block dialog box to the mask:

  • To customize the mask dialog box by moving the required parameters from the block dialog box to the mask dialog box.

  • To reuse a library block at different instances of a model. For each instance of the library block, you can create individual mask dialog box by promoting parameters for each block.

Consider the block dialog box of the Gain block, which has parameters such as Gain, Multiplication.

To expose only the Gain parameter, mask the Gain block and promote the Gain parameter to the mask dialog box.

Similarly, you can mask a subsystem block and promote parameters to the mask from child blocks of the subsystem block. If the data type of subsystem child block parameters is same, you can associate a single mask parameter with multiple promoted parameters. For example, you can promote multiple Gain parameters in a subsystem to a single dialog box on your mask.

If the parameter is of data type popup or DataType, the options must also be the same for the parameters to be promoted together. The Evaluate attribute for all the parameters to be promoted must be similar.

For a related example, see Promote mask parameters

You can also change the attributes of a promoted parameter. For example, you can make a promoted parameter read only or hidden. For more information on attributes, see Property editor.

Promote Underlying Parameters to Block Mask

  1. Right-click the block whose parameter you want to promote and select Mask > Create Mask.

  2. In the Mask Editor dialog box, click the Parameters & Dialog tab.

  3. In the Controls pane, click Promote.

  4. In the Property editor pane, next to Type options, click .

    Use the Promoted Parameter Selector dialog box to select the parameters that you want to promote.

  5. To add a parameter to the Promoted parameters list, select a parameter from the Promotable parameters table and click the Add to promoted parameter list button .

    To view the parameter properties such as Type, hover over the parameter name in the Promotable parameter pane.

    Tip

    • You can use the Child blocks list or the Search box to find underlying block parameters to promote.

    • To prevent tuning of a property during simulation, you can disable the Tunable attribute while promoting a tunable parameter.

  6. Click OK.

  7. In the Mask Editor dialog box, edit the prompt names for the promoted parameters and click OK. You cannot edit the variable names. You can change the attributes of the promoted parameter in the Property editor section. For example, you can mark the promoted parameter as read-only, evaluate, hidden, and tunable. For more information, see Property editor.

  8. Click OK. Look at the block mask. Only the parameters you promoted are available to set.

    Note

    • You can use Promote all to promote all parameters. Promote all is available for all block masks except for subsystem masks.

    • To remove a promoted parameter, select the parameter and press Delete key.

    • You cannot view or promote parameters of a nested masked or linked child block.

Promote Underlying Parameters to Subsystem Mask

  1. Right-click the subsystem and select Mask > Create Mask.

  2. In the Mask Editor dialog box, click the Parameters & Dialog tab.

  3. In the Controls pane, click Promote.

  4. In the Property editor pane, next to Type options, click .

  5. In the Promoted Parameter Selector dialog box, select the parameters that you want to promote.

  6. To add a parameter to the Promoted parameters list, select a parameter from the Promotable parameters table and click the Add to promoted parameter list button .

    You can add parameters of the same data type from different child blocks to the Promoted parameters list. For example, the Gain parameter from a different child block can be added to the Promoted parameters list to promote to the single Gain parameter on the mask.

  7. Click OK.

  8. In the Mask Editor dialog box, edit the prompt names for the promoted parameters and click OK. You cannot edit the variable names.

  9. Click OK. Look at the block mask. Only the parameters you promoted are available to set.

Unresolved Promoted Parameter

When a promoted parameter is disconnected from the underlying block parameter, the promoted parameter is unresolved. Unresolved promoted parameters can cause the model to be erroneous as the promoted parameter cannot find the corresponding block parameter. Promoted parameters can become unresolved for any of these reasons:

  • The underlying block is deleted.

  • The underlying block is replaced with another block of same name but does not have the specified parameter.

  • The underlying block is moved within another mask.

Best Practices

  • Set the value of a promoted parameter only in the mask dialog box and not in the underlying block dialog box or from the command line.

  • Parameters once promoted cannot be promoted again to any other mask.

  • Do not edit the Evaluate attribute of the promoted parameter. This property is inherited from the block parameter.

  • If you are promoting a nontunable parameter, do not edit the Tunable attribute.

  • Parameters of a masked or linked child block cannot be viewed or promoted.

  • Callbacks associated with a block parameter are promoted to the block mask and not to the subsystem mask. User-defined callbacks are sequentially executed after the dynamic dialog callback execute.

See Also

| |