| 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… |
|---|
Finding a Reference Block's Library Block Prototype Getting Information About Library Blocks Referenced by a Model |
A reference block is an instance of a block type in a model that contains a link to a 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 reference block to update whenever the corresponding prototype in the library changes (Updating a Reference Block). This ensures that your model always uses the latest version of the block.
Note The data tip for a reference block shows the name of the library block it references (see Block Data Tips). |
You can change the values of a reference block's parameters but you cannot mask the block or edit its mask. Also, you cannot set callback parameters for a reference block. If the reference block's prototype is a subsystem, you can make nonstructural changes to the contents of the referenced subsystem (see Modifying Reference Blocks).
To create a reference block in a model or another library:
Open your model.
Open the Simulink Library Browser (see About the Library Browser).
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 reference blocks in a model or library at these times:
When the model or library is loaded
When you select Update Diagram from the Edit menu or run the simulation
When you use the find_system command
When you query the LinkStatus parameter of a block, using the get_param command (see Determining Link Status )
You cannot make structural changes to reference 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 reference block's link to its library prototype (see Disabling Links to Library Blocks ).
You can, however, change the values of any masked subsystem reference 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 link to a library block from a reference block whose parameter values differ from those of the corresponding library block is called 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 subsystem into the loaded model and applies the saved changes.
Tip To determine whether a reference block's parameter values differ from those of its library prototype, open the reference block's block diagram in an editor window. The title bar of the editor window displaying the subsystem displays "parameterized link" if the reference block 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 block linked to a reference block, select the reference 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 opens it and selects the library block.
Use the libinfo command to get information about reference blocks in a system.
![]() | About Block Libraries | Working with Library Links | ![]() |

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 |