| Contents | Index |
| On this page… |
|---|
A linked block is an instance of a library block and contains a link to that library block that serves as the block type's prototype. The link consists of the path of the library block that serves as the instance's prototype. The link allows the linked block to update whenever the corresponding prototype in the library changes (Updating a Linked Block). This ensures that your model always uses the latest version of the block.
Note The data tip for a linked block shows the name of the library block it references (see Block Data Tips). |
You can change the values of a linked block's parameters (including in an existing mask). You cannot add a new mask for linked blocks or edit the mask setup, that is, add or remove mask parameters or change mask behavior.
Also, you cannot set callback parameters for a linked block. If the linked block's prototype is a subsystem, you can make nonstructural changes to the contents of the linked subsystem (see Modifying Linked Blocks).
To create a linked block in a model or another library:
Open your model.
Open the Simulink Library Browser (see Opening the Library Browser), or another library.
Use the Library Browser to find the library block that serves as a prototype of the block you want to create (see Browsing Block Libraries and Searching Block Libraries).
Drag the library block from the Library Browser's Library pane and drop it into your model.
Simulink updates out-of-date linked blocks in a model or library when you:
Load the model or library.
Run the simulation.
Use the find_system command.
Query the LinkStatus parameter of a block, using the get_param command (see Checking and Setting Link Status Programmatically ).
Save changes to a library block, then Simulink automatically refreshes all links to the block in open Model Editor windows.
When you edit a library block (in the Model Editor or at the command line), then Simulink indicates stale links which are open in the Model Editor by displaying the linked blocks grayed out. When you click the Model Editor window, Simulink refreshes any stale links to edited blocks, even if you have not saved the library yet.
To manually refresh links:
Select Edit > Links and Model Blocks > Refresh (or press Ctrl+K) to refresh links.
Select Go To Library Link.
You cannot make structural changes to linked blocks, such as adding or deleting lines or blocks to the block diagram of a masked subsystem. If you want to make such changes, you must disable the linked block's link to its library prototype (see Disabling Links to Library Blocks ).
If you change parameter values inside a linked block, you create a parameterized link. You can change the values of any masked subsystem linked block parameter that does not alter the block's structure, e.g., by adding or deleting lines, blocks, or ports. An example of a nonstructural change is a change to the value of a mathematical block parameter, such as the Gain parameter of the Gain block. A linked subsystem block whose parameter values of inner blocks differ from their corresponding library blocks is called a parameterized link. Changing the top-level mask values does not create a parameterized link.
When saving a model containing a parameterized link, Simulink saves the changes to the local copy of the subsystem together with the path to the library copy in the model's model (.mdl) file. When you reopen the system, Simulink copies the library block into the loaded model and applies the saved changes.
Tip To determine whether a linked block's parameter values differ from those of its library prototype, open the linked block's block diagram in an editor window. The linked block's library link indicator (if displayed) changes to a red arrow and the title bar of the editor window displaying the subsystem displays "Parameterized Link" if the linked block's parameter values differ from the library block's parameter values. |
Simulink allows linked subsystems to change their own structural contents without disabling the link. This allows you to create masked subsystems that modify their structural contents based on mask parameter dialog box values.
To find the source library and the prototype of a linked block, select the linked block. Then choose Go To Library Link from the Link Options submenu of the model window's Edit or context menu. If the library is open, Simulink selects and highlights the library block and makes the source library the active window. If the library is not open, Simulink first opens it and then selects the library block.
Use the libinfo command to get information about the linked blocks in the model and which library blocks they link to. The ReferenceBlock property gives the path of the library block to which a block links.
![]() | About Block Libraries and Linked Blocks | Working with Library Links | ![]() |

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