Main Content

Total number of instances allowed per top model

Number of references to this model that can occur in another model

Model Configuration Pane: Model Referencing

Description

The Total number of instances allowed per top model configuration parameter determines how many references to this model can occur in another model.

Set Configuration Parameter for Referenced Model

In a model reference hierarchy, how you open the Configuration Parameters dialog box determines whether you edit the configuration parameter for the top model in the current model hierarchy or the current referenced model.

  • Top model in the current model hierarchy — In the Simulink® Toolstrip, on the Modeling tab, click Model Settings.

  • Current referenced model — In the Simulink Toolstrip, on the Modeling tab, click the Model Settings button arrow. Then, in the Referenced Model section, select Model Settings.

Alternatively, open the referenced model as a top model. Then, in the Simulink Toolstrip, on the Modeling tab, click Model Settings.

Settings

Multiple (default) | One | Zero
Zero

A model cannot reference this model. An error occurs if another model references this model.

One

A model hierarchy can reference this model at most once. An error occurs if more than one reference exists in a model hierarchy.

Multiple

A model hierarchy can reference this model more than once, if it contains no constructs that preclude multiple references. An error occurs if this model cannot be referenced multiple times, even if only one reference exists. For model reuse requirements, see Model Reuse.

To use multiple instances of a referenced model in normal mode, use the Multiple setting. For details, see Simulate Multiple Referenced Model Instances in Normal Mode.

Tips

Setting Total number of instances allowed per top model to Multiple for a model that is referenced only once can reduce execution efficiency slightly. However, this setting does not affect data values that result from simulation or from executing Simulink Coder™ generated code. Specifying Multiple when only one model instance exists avoids having to change or rebuild the model when reusing the model:

  • In the same hierarchy

  • Multiple times in a different hierarchy

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precaution

No recommendation

Programmatic Use

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

Version History

Introduced before R2006a