Skip to Main Content Skip to Search
Product Documentation

Model Referencing Pane

Model Referencing Pane Overview

Specify the options for including other models in this model, this model in other models, and for building simulation and code generation targets.

Configuration

Set the parameters displayed.

Tips

See Also

Rebuild

Select the method used to determine when to rebuild simulation and Simulink Coder targets for referenced models before updating, simulating, or generating code from this model.

There are four rebuild options. Two options, Always and Never, either always rebuild the model reference target or never rebuild the target, respectively. The other two options (If any changes detected and If any changes in known dependencies detected) cause Simulink to check the model and its dependencies to determine whether or not to rebuild the model reference target. As part of this checking, Simulink:

For additional background information to help you determine which rebuild option setting to use, see the "Definitions" and "Tips" sections.

Settings

Default: If any changes detected

Always

Always rebuild targets referenced by this model before simulating, updating, or generating code from this model.

If any changes detected

Rebuild a target for a referenced model if Simulink detects a change that could affect simulation results. To do this, Simulink first looks for changes to the known target dependencies and to the model, and, if none are found, it then computes the structural checksum of the model to check that the model reference target is up to date.

If any changes in known dependencies detected

Rebuild a target if Simulink detects a change in known target dependencies or in both the model and its structural checksum. If Simulink does not detect a change in known target dependencies or the model, it does not compute the structural checksum of the model and does not rebuild the model reference target. You must list all user-created dependencies in the Model dependencies parameter.

Never

Never rebuild targets referenced by this model before simulating, updating, or generating code from this model.

Definitions

Known target dependencies

Known target dependencies are files and data outside of .mdl files that Simulink examines for changes when checking to see if a model reference target is up to date. Simulink automatically computes a set of known target dependencies. Simulink examines the known target dependencies to determine whether they have changed, which it can do quickly. Examples of known target dependencies are:

  • Global variables

  • Changes to the model workspace, if its data source is a MAT-file or MATLAB file

  • Enumerated type definitions

  • User-written S-functions and their TLC files

  • Files specified in the Model dependencies parameter

User-created dependencies

Although Simulink automatically examines every known target dependency, you can have files that can impact the simulation results of your model that Simulink does not automatically identify. Some examples of user-created dependencies are:

  • MATLAB files that contain code executed by callbacks

  • MAT-files that contain definitions for variables used by the model that are loaded as part of a customized initialization script

You can add user-created dependencies to the set of known target dependencies by using the Model dependencies parameter.

Structural checksum

As part of determining whether a model reference target is up to date, Simulink may compute the structural checksum of a model, which reflects changes to the model that can affect simulation results.

When Simulink computes the structural checksum, it loads and compiles the model. To compile the model, Simulink must execute callbacks and access all variables that the model uses. As a result, the structural checksum reflects changes to the model that can affect simulation results, including changes in user-created dependencies, regardless of whether you have specified those user-created dependencies in the Model dependencies parameter.

For more information about the kinds of changes that affect the structural checksum, see the Simulink.BlockDiagram.getChecksum documentation.

Tips

Dependency

Selecting Never enables the Never rebuild diagnostic parameter.

Command-Line Information

Parameter: UpdateModelReferenceTargets
Type: string
Value: 'Force' | 'IfOutOfDateOrStructuralChange' | 'IfOutOfDate' | 'AssumeUpToDate'
Default: 'IfOutOfDateOrStructuralChange'
UpdateModelReferenceTargets ValueEquivalent Rebuild Value
'Force'Always
'IfOutOfDateOrStructuralChange'If any changes detected
'IfOutOfDate'If any changes in known dependencies detected
'AssumeUpToDate'Never

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precaution

If any changes detected or Never

If you use the Never setting, then set the Never rebuild diagnostic parameter to Error if rebuild required.

See Also

Never rebuild diagnostic

Select the diagnostic action that Simulink software should take if it detects a model reference target that needs to be rebuilt.

Settings

Default: Error if rebuild required

none

Simulink takes no action.

Warn if rebuild required

Simulink displays a warning.

Error if rebuild required

Simulink terminates the simulation and displays an error message.

Tip

If you set the Rebuild parameter to Never and set the Never rebuild diagnostic parameter to Error if rebuild required or Warn if rebuild required, then Simulink:

Selecting None bypasses dependency checking, and thus enables faster updating, simulation, and code generation. However, the None setting can cause models that are not up to date to malfunction or generate incorrect results. For more information on the dependency checking, see Rebuild.

Dependency

This parameter is enabled only if you select Never in the Rebuild field.

Command-Line Information

Parameter: CheckModelReferenceTargetMessage
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionError if rebuild required

See Also

Enable parallel model reference builds

Specify whether to use automatic parallel building of the model reference hierarchy whenever possible.

Settings

Default: Off

On

Simulink software builds the model reference hierarchy in parallel whenever possible (based on computing resources and the structure of the model reference hierarchy).

Off

Simulink never builds the model reference hierarchy in parallel.

Dependency

Selecting this option enables the MATLAB worker initialization for builds parameter.

Command-Line Information

Parameter: EnableParallelModelReferenceBuilds
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

MATLAB worker initialization for builds

Specify how to initialize MATLAB workers for parallel builds.

Settings

Default: None

None

Simulink software takes no action. Specify this value if the child models in the model reference hierarchy do not rely on anything in the base workspace beyond what they explicitly set up (for example, with a model load function).

Copy base workspace

Simulink attempts to copy the base workspace to each MATLAB worker. Specify this value if you use a setup script to prepare the base workspace for all models to use.

Load top model

Simulink loads the top model on each MATLAB worker. Specify this value if the top model in the model reference hierarchy handles all of the base workspace setup (for example, with a model load function).

Limitation

For values other than None, limitations apply to global variables in the base workspace. Global variables are not propagated across parallel workers and do not reflect changes made by top and child model scripts.

Dependency

Selecting the option Enable parallel model reference builds enables this parameter.

Command-Line Information

Parameter: ParallelModelReferenceMATLABWorkerInit
Type: string
Value: 'None' | 'Copy Base Workspace' | 'Load Top Model'
Default: 'None'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Total number of instances allowed per top model

Specify how many references to this model can occur in another model.

Settings

Default: Multiple

Zero

The model cannot be referenced. An error occurs if a reference to the model occurs in another model.

One

The model can be referenced at most once in a model reference hierarchy. An error occurs if more than one reference exists.

Multiple

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.

To use multiple instances of a referenced model in Normal mode, use the Multiple setting. For details, see Using Normal Mode for Multiple Instances of Referenced Models.

Command-Line Information

Parameter: ModelReferenceNumInstancesAllowed
Type: string
Value: 'Zero' | 'Single' | 'Multi'
Default: 'Multi'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Pass fixed-size scalar root inputs by value for code generation

Specify whether a model that calls (references) this model passes its scalar inputs to this model by value.

Settings

Default: Off (GUI), 'on' (command-line)

On

A model that calls (references) this model passes scalar inputs to this model by value.

Off

The calling model passes the inputs by reference (it passes the addresses of the inputs rather than the input values).

Tips

Command-Line Information

Parameter:ModelReferencePassRootInputsByReference
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionOff

See Also

Minimize algebraic loop occurrences

Try to eliminate artificial algebraic loops from a model that involve the current referenced model

Settings

Default: Off

On

Simulink software tries to eliminate artificial algebraic loops from a model that involve the current referenced model.

Off

Simulink software does not try to eliminate artificial algebraic loops from a model that involve the current referenced model.

Tips

Command-Line Information

Parameter:ModelReferenceMinAlgLoopOccurrences
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionOff

See Also

Propagate sizes of variable-size signals

Select how variable-size signals propagate through referenced models.

Settings

Default: Infer from blocks in model

Infer from blocks in model

Searches a referenced model and groups blocks into the following categories.

CategoryDescriptionExample Blocks in This Category
1Output signal size depends on input signal values.Switch or Enable Subsystem block whose parameter Propagate sizes of variable-size signals is set to During execution
2States require resetting when the input signal size changes.Unit Delay block in an Enabled Subsystem whose parameter Propagate sizes of variable-size signals is set to Only when enabling
3Output signal size depends only on the input signal size.Gain block.

The search stops at the boundary of Enable, Function-Call, and Action subsystems because these subsystems can specify when to propagate the size of a variable-size signal.

Simulink sets the propagation of variable-size signals for a referenced model as follows:

  • One or more blocks in category 1, and all other blocks are in category 3, select During execution.

  • One or more blocks in category 2, and all another blocks are in category 3, select Only when enabling.

  • Blocks in category 1 and 2, report an error.

  • All blocks in category 3 with a conditionally executed subsystem that is not an Enable, Function-Call, or Action subsystem, report an error. Simulink, in this case, cannot determine when to propagate sizes of variable-size signals.

  • All blocks in category 3 with only conditionally executed subsystems that are an Enable, Function-Call, or Action subsystem, support both Only with enabling and During execution.

Only when enabling

Propagates sizes of variable-size signals for the referenced model only when enabling (at Enable method).

During execution

Propagates sizes of variable-size signals for the referenced model during execution (at Outputs method).

Command-Line Information

Parameter: PropagateVarSize
Type: string
Value: 'Infer from blocks in model' | 'Only when enabling'| 'During execution'
Default: 'Infer from blocks in model'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionOff

See Also

Model dependencies

Although Simulink automatically examines every known target dependency, you can have files that can impact the simulation results of your model that Simulink does not automatically identify. Some examples of user-created dependencies are:

You can add user-created dependencies to the set of known target dependencies by using the Model dependencies parameter.

Simulink examines the files specified with the Model dependencies parameter when determining whether the model reference target is up to date. If the Rebuild parameter is set to:

Settings

Default: ''

Tips

Command-Line Information

Parameter: ModelDependencies
Type: string
Value: any valid value
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

  


Related Products & Applications

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