| Simulink® | ![]() |

| On this page… |
|---|
Model Referencing Pane Overview Never rebuild targets diagnostic Total number of instances allowed per top model |
Specify the options for including other models in this model, this model in other models, and for building simulation and code generation targets.
Set the parameters displayed.
The Model Referencing pane allows you to specify options for:
Including other models in this model.
Including the current model in other models.
The option descriptions use the term this model to refer to the model that you are configuring and the term referenced model to designate models referenced by this model.
Select whether to rebuild simulation and Real-Time Workshop targets for referenced models before updating, simulating, or generating code from this model.
Default: If any changes detected
Rebuilds the target for a referenced model if Simulink software detects any changes of any kind in the target's dependencies. This option also checks for changes in the compiled form of the referenced model. Checking the compiled model can detect some changes that occur even in dependencies that you do not specify.
Rebuilds all targets referenced by this model before simulating, updating, or generating code from it.
Rebuilds a target if Simulink software detects any changes in known target dependencies (see below) since the target was last built. This option ignores cosmetic changes, such as annotation changes, in the referenced model and in any block library dependencies, thus preventing unnecessary rebuilds.
Never rebuild targets before simulating or generating code from this model. If you are certain that your targets are up-to-date, you can use this option to avoid time-consuming target dependency checking when simulating, updating, or generating code from a model.
Simulink software detects target dependencies in:
The referenced model's model file
Block library files used by the referenced model
Targets of models referenced by the referenced model
S-functions and associated TLC files used by the referenced model
User-specified dependencies (see Model Dependencies)
Workspace variables used by the referenced model
It is a good idea to use the Always option before deployment of a model to assure that all the model reference targets are up-to-date.
Before selecting If any changes in known dependencies detected, you should be certain that you have specified every user-created dependency (e.g., M-files or MAT-files) for this model to ensure that all targets that need to be rebuilt are rebuilt. Otherwise, invalid simulation results may occur.
The If any changes in known dependencies detected option cannot detect changes in unspecified dependencies, such as M-files used to initialize block masks. If you suspect that a model has such unknown dependencies, you can still guarantee valid simulation by selecting the Always or the If any changes detected option.
Use the Never option with caution because it may lead to invalid results if referenced model targets are not in fact up-to-date.
Selecting Never enables the Never rebuild targets diagnostic parameter.
| Parameter: UpdateModelReferenceTargets |
| Type: string |
| Value: 'IfOutOfDate' | 'Force' | 'AssumeUpToDate' | 'IfOutOfDateOrStructuralChange' |
| Default: 'IfOutOfDateOrStructuralChange' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | Never or If any changes detected |
Select the diagnostic action that Simulink software should take if it detects a target that needs to be rebuilt.
Default: Error if targets require rebuild
Simulink software takes no action.
Simulink software displays a warning.
Simulink software terminates the simulation and displays an error message.
Selecting None bypasses dependency checking, and thus enables faster updating, simulation, and code generation, but can cause models that are not up-to-date to malfunction or generate incorrect results.
This parameter is enabled only if you select Never in the Rebuild options field.
| Parameter: CheckModelReferenceTargetMessage |
| Type: string |
| Value: 'none' | 'warning' | 'error' |
| Default: 'error' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | error if targets require rebuild |
Specify how many references to this model can occur in another model.
Default: Multiple
The model cannot be referenced. An error occurs if a reference to the model occurs in another model.
The model can be referenced at most once in a model reference hierarchy. An error occurs if more than one reference exists.
The model can be referenced more than once in a hierarchy, provided that it contains no constructs that preclude multiple reference. An error occurs if the model cannot be multiply referenced, even if only one reference exists.
| Parameter: ModelReferenceNumInstancesAllowed |
| Type: string |
| Value: 'Zero' | 'Single' | 'Multi' |
| Default: 'Multi' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify the files on which this model relies. They are typically MAT-files and M-files used to initialize parameters and to provide data.
No Default
Specify the dependencies as a cell array of strings, where each cell array entry is the filename or path of a dependent file. These filenames may include spaces and must include file extensions (e.g.,.m,.mat, etc.).
Prefix the token $MDL to a dependency to indicate that the path to the dependency is relative to the location of this model file.
Wildcards are allowed. Use a '%' to comment out a line; use '...' to continue lines.
If Simulink software cannot find a specified dependent file when you update or simulate a model that references this model, Simulink software displays a warning.
The dependencies automatically include the model.mdl and linked library .mdl files.
For files not on the MATLAB path, use absolute paths.
| Parameter: ModelDependencies |
| Type: string |
| Value: any valid value |
| Default: '' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether a model that calls (references) this model passes this model's scalar inputs by value.
Default: Off
A model that calls (i.e., references) this model passes this model's scalar inputs by value.
The calling model passes the inputs by reference (it passes the addresses of the inputs rather than the input values).
Passing roots by value allows this model to read its scalar inputs from register or local memory which is faster than reading the inputs from their original locations.
However, passing roots by value can lead to incorrect results if the model's root scalar inputs can change within a time step. This can happen, for instance, if this model's inputs and outputs share memory locations (as a result of a feedback loop) and the model is invoked multiple times in a time step (i.e., by a Function-Call Subsystem). In such cases, this model sees scalar input changes that occur in the same time step only if the inputs are passed by reference. That is why this option is off by default.
If you are certain that this model is not referenced in contexts where its inputs can change within a time step, select this option to generate more efficient code for this model.
Selecting this option can affect reuse of code generated for subsystems. See Reusable Code and Referenced Models for more information.
| Parameter: ModelrefPassRootInputsByReference |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | Off |
Specify whether Simulink software tries to eliminate algebraic loops involving this model from models that reference it.
Default: Off
Simulink software tries to eliminate algebraic loops involving this model from models that reference it.
Simulink software does not try to eliminate algebraic loops from the models that reference this model.
Enabling this option disables:
Conditional input branch optimization for simulation
The Real-Time Workshop software Single update/output function optimization for code generation
See Algebraic Loops for more information.
| Parameter: ModelrefMinAlgLoopOccurrences |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | Off |
![]() | Hardware Implementation Pane | Simulation Target Pane | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |