Main Content

Parameterized Links and Self-Modifiable Linked Subsystems

A parameterized link is created when you change the parameter values of the child blocks of a linked subsystem block without changing the parameter values or disabling links in the parent library block.

Similarly, you can change the structure of a linked subsystem without modifying the parent library block when you have a linked subsystem block with a self-modifiable mask.

Parameterized Links

A parameterized link provides the flexibility to have different parameter values for the linked block compared to the parent library block. You can override or customize specific parameter values in the linked block without affecting the original values in the parent library block. For such parameterized linked blocks, the link to the parent block is still retained.

Note

Changing the mask value of a parent library block does not create a parameterized link.

Consider a custom library Libraries with a subsystem block Subsystem. Subsystem contains a Gain block with its parameter value set as 1.

View of subsystem block in custom library

Add the Subsystem block in a model to create linked blocks Subsystem and Subsystem1.

View of model with linked subsystems

In your model, you can modify the parameter values of the child blocks of the linked blocks without changing the value of the parent library block. For example, you can change the parameter value of the Gain block inside the linked Subsystem block to 100. For more information on changing parameter values, see Edit Block Parameters

To change the parameter values programmatically use these commands:

pathName = [ModelName,'/Gain_Subsystem/Gain'];
set_param(pathName, 'Gain', '100')

Similarly, you can change the parameter value of the Gain block inside the linked Subsystem1 block to 200.

View of parameterized linked blocks

When you modify a parameter value in a linked block, it overrides the previous parameter value that was obtained from the parent library block. This differentiation between the child block value and its parent library block creates a parameterized link.

When you save a model containing a parameterized link, Simulink® saves the changes to a local copy of the Subsystem with the path to the parent library. When you reopen the model, Simulink copies the library block into the loaded model and applies the saved changes.

To view the parameterized links in a model, in the Simulink toolstrip go to Subsystem Block tab, and click Link Manager. The Library Link Manager opens. Click the Parameterized Links tab to display all the parameterized links in the model.

View of Library Link Manager

Identifying Parameterized Links

To identify a parameterized link, use these identifications on the link badge of the linked subsystem block:

  • Black links with a red star icon on the link badge . For more information, see Display Library Links.

  • Tooltip of the link badge displays Modified parameter in link.

Self-Modifiable Linked Subsystems

Tip

We recommend using variant blocks over self-modifiable linked subsystems.

A self-modifiable linked subsystem is a linked block with the ability to have structural changes in the subsystem without disabling the link with the parent library block. A self-modifiable linked subsystem is created when you use a library block containing a self-modifiable mask as the linked block. You can use the mask initialization code to change the structural contents. For more information, see Dynamic Masked Subsystem and Self-Modifiable Mask.

Related Topics