| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
Disabling Links to Library Blocks Restoring Disabled or Parameterized Links |
A model can have a block linked to a library block, or it can have a local instance of a block that is not linked. To enable the display of library links:
In the Model Editor window, and from the Format menu, select Library Link Display.
From the submenu, select either User (displays only links to user libraries) or All (displays all links).
The library link indicator is an arrow in the bottom left corner of each block.

The color of the link arrow indicates the status of the link.
| Color | Status |
|---|---|
Black | Active link |
Grey | Inactive link |
Red | Active and modified (parameterized link) |
To make a structural change to a linked subsystem block, you need to disable the link between the block and the library block that serves as its prototype.
Note When you use the Model Editor to make a structural change (such as editing the diagram) to a local copy of a subsystem block with an active library link, Simulink offers to disable the library link for you. If you accept, Simulink disables the link and allows you to make changes to the subsystem block. Do not use set_param to make a structural change to an active link; the result of this type change is undefined. |
To disable a link:
In the Model Editor window, select a subsystem block.
From the Edit menu, select Link Options, and then select Disable link.
The model breaks the library link and grays out the library link indicator. When a library block is disabled and it is within another library block (a child of a parent library block), the model also disables the parent block containing the child block.
After you make structural changes to a linked subsystem block, you need to restore the link to its library block and resolve any differences between the two blocks. The Links Tool helps you with this task.
In the Model Editor window, select a linked subsystem block with a disabled library link.
From the Edit menu, select Link Options, and then select Resolve link.
The Links Tool window opens.

The table in the Edited links panel has the following columns:
Linked block — List of linked blocks. The list of edited links includes library links with structural changes, parameterized library links, and library links that were actively chosen to be resolved.
Action — Choose and action to perform on the linked block or library.
Library — List of library names and version numbers.
From the Linked block list, select a block name.
The Links Tool updates the Paths for selected link panel with links to the linked block in the model and in the library.
From the Action list, choose one of two actions.
| Action Choice | Simulink Action |
|---|---|
| Push | Updates the library version with the changes you made in the model version of that subsystem. |
| Restore | Replaces the version of the subsystem in the model with the version in the library. |
Choosing the Push all, Restore all or Clear all button selects an action for all linked blocks.
Click OK or Apply.
Simulink restores the library links to the selected subsystems in the model. The subsystem versions in the library and the model now match. If the link for a child that was structurally changed is restored, and there were no structural changes with its parent, the parent link is also restored.
Changes pushed to the library are not saved until you actively save the library.
If a linked block name has a cautionary icon
before
it, the model has other instances of this block linked from the same
library block, and they have different changes. Choose one of the
instances (In this case, Braking chopper, Braking chopper 1, or Braking
chopper 2) to push changes to the library block and restore links
to the other blocks , or choose to restore all of them with the library
version.
![]()
All blocks have a LinkStatus parameter and a StaticLinkStatus parameter that indicate whether the block is a reference block. The parameters can have these values.
Note Using get_param to query a block's LinkStatus also resolves any out-of-date block references. It is, therefore, useful to update library links in a model programmatically. Conversely, querying the StaticLinkStatus property does not resolve any out-of-date references. Query the StaticLinkStatus property when the call to get_param is in the callback of a child block querying the link status of its parent. |
| Status | Description |
|---|---|
| none | Block is not a reference block. |
| resolved | Resolved link. |
| Unresolved | Unresolved link. |
| Implicit | Block resides in library block and is itself not a link to a library block. For example, suppose that A is a link to a subsystem in a library that contains a Gain block. Further, suppose that you open A and select the Gain block. Then, get_param(gcb, 'LinkStatus') returns implicit. |
| Inactive | Link disabled. |
| Restore | Restores an inactive or disabled link to a library block and discards any changes made to the local copy of the library block. For example, set_param(gcb, 'LinkStatus', 'restore') replaces the selected block with a link to a library block of the same type, discarding any changes in the local copy of the library block. The function get_param never return Restore. It is only used with set_param. |
| Propagate | Restores an inactive or disabled link to a library block and pushes any changes made to the local copy to the library. The function get_param never return Propagate. It is only used with set_param. |
You can break the link between a reference block and its library block to cause the reference block to become a simple copy of the library block, unlinked to the library block. Changes to the library block no longer affect the block. Breaking links to library blocks may enable you to transport a Masked Subsystem Example model as a standalone model, without the libraries.
To break the link between a reference block and its library block, first disable the link. Then select the block and choose Break Link from the Link Options menu. You can also break the link between a reference block and its library block from the command line by changing the value of the LinkStatus parameter to 'none' using this command:
set_param('refblock', 'LinkStatus', 'none')
You can also break links to library blocks when saving the model, by supplying arguments to the save_system command. See save_system in the Simulink reference documentation.
Note Breaking library links in a model does not guarantee that you can run the model standalone, especially if the model includes blocks from third-party libraries or optional Simulink blocksets. It is possible that a library block invokes functions supplied with the library and hence can run only if the library is installed on the system running the model. Further, breaking a link can cause a model to fail when you install a new version of the library on a system. For example, suppose a block invokes a function that is supplied with the library. Now suppose that a new version of the library eliminates the function. Running a model with an unlinked copy of the block results in invocation of a now nonexistent function, causing the simulation to fail. To avoid such problems, you should generally avoid breaking links to third-party libraries and optional Simulink blocksets. |
If Simulink is unable to find either the library block or the source library on your MATLAB path when it attempts to update the reference block, the link becomes unresolved. Simulink issues an error message and displays these blocks using red dashed lines. The error message is
Failed to find block "source-block-name" in library "source-library-name" referenced by block "reference-block-path".
The unresolved reference block appears like this (colored red).

To fix a bad link, you must do one of the following:
Delete the unlinked reference block and copy the library block back into your model.
Add the directory that contains the required library to the MATLAB path and select Update Diagram from the Edit menu.
Double-click the unlinked reference block to open its dialog box (see the Bad Link block reference page). On the dialog box that appears, correct the pathname in the Source block field and click OK.
![]() | Working with Reference Blocks | Creating Block Libraries | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |