To be used, a configuration reference must point to freestanding configuration set. To create a freestanding configuration set before creating a configuration reference, see Create a Configuration Set in the Base Workspace.
To create a configuration reference:
In the Model Explorer, in the Model Hierarchy pane, select the model.
Select Add > Configuration Reference or click the Add Configuration Reference tool .
In the right panel, specify the Name of the configuration set object in the base workspace to be referenced.
If you chose to create a configuration reference without first creating a configuration set object, a warning indicates that your configuration reference cannot be found. In this case, an unresolved configuration reference is created. For more information, see Unresolved Configuration References. Follow the instructions in Resolve a Configuration Reference.
A new configuration reference appears in the Contents pane of
the Configurations node for the selected model. The default name of the new reference
An unresolved configuration reference is a configuration reference that is not pointing to a valid configuration set object.
To resolve a configuration reference:
In the Model Hierarchy pane, select the Configurations node. In the Contents pane, select the unresolved configuration reference.
The Configuration Reference dialog box opens in the Dialog pane.
Specify the Referenced configuration set to be a configuration set object already in the base workspace or data dictionary. If one does not exist, see Create a Configuration Set in the Base Workspace.
You can specify the name of a configuration reference. But, nesting of a configuration reference beyond this depth results in an error.
Click OK or Apply. The warning icon disappears.
After you create a configuration reference and attach it to a model, you can activate it so that it is the active configuration.
From the context menu of the configuration reference, select Activate.
From the command line, execute
setActiveConfigSet, specifying the configuration reference as the second
When a configuration reference is active, the Is Active field of
the Configuration Reference dialog box changes to
yes. Also, the Model
Explorer shows the name of the reference with the suffix
The freestanding configuration set of the active reference now provides the configuration parameters for the model.
In a model hierarchy, you can share a configuration reference across referenced models. Using the Configuration Reference Propagation dialog box, you can propagate a configuration reference of a top model to an individual referenced model or to all referenced models in the model hierarchy. The dialog box provides:
A list of referenced models in the top model.
The ability to select only specific referenced models for propagation.
After propagation, the status for the converted configuration for each referenced model.
A view of the changed parameters after the propagation.
The ability to undo the configuration reference and restore the previous configuration settings for a referenced model.
To open the dialog box, in the Model Explorer, in the Model
Hierarchy pane, select the Configurations node. In the
Contents pane, right-click the configuration reference of a model. In
the context menu, select
Propagate to Referenced Models. For an
example, see Share a Configuration Across Referenced Models.
From the Configuration Reference dialog box, you can open the referenced configuration set to change parameter values. Making changes to the standalone configuration set affects configuration references that refer to it, except for parameters that are overridden in those references. To obtain a referenced configuration set:
To open the Configuration Reference dialog box, on the Modeling tab, click the Model Configuration Parameters button . The Configuration Reference dialog box displays a read-only view of the referenced configuration. In the dialog box you can browse, search, and get context-sensitive help for the parameters in the same way you do in the Configuration Parameters dialog box.
At the top of the Configuration Reference dialog box, click the Model Configuration Parameters icon. The Configuration Parameters dialog box opens. You can now change and apply parameter values as you would for any configuration set.
Your applied changes appear in the Configuration Reference dialog box.
When one reference to a standalone configuration requires a different value for a
parameter, you can override that parameter in the configuration reference. Override a
parameter to change its value in the reference without changing the standalone
configuration. For an overridden parameter, the reference uses the value you assign locally
instead of the value in the referenced configuration set. For example, the models of a
hierarchy may reference a standalone configuration in which the parameter Model
Referencing > Total number of instances allowed per top
model is set to
Multiple. If you want to reference a model
only once in the hierarchy, you can override the parameter for the configuration reference
of only that model and set the value to
One. Simulink® detects a violation if the hierarchy references that model more than one
To open the Configuration Reference dialog box, on the Modeling tab, click the Model Configuration Parameters button .
Right-click the parameter you want to change and select Override from the context menu. You can now change the parameter value as you would for any configuration set. In the left pane, each component displays the number of overridden parameters it contains.
Click Apply to keep the changes or Cancel to restore the parameter to the referenced value. Changes you make to a parameter value apply only to the configuration reference in which you override and edit the parameter. They do not affect other references to the referenced configuration set.
To restore an overridden parameter to its value from the referenced configuration set, right-click the overridden parameter and select Restore from the context menu. The overridden parameter resets to the value in the referenced configuration and becomes read-only again.
If your model uses a configuration reference to specify the model configuration, before closing your model, you need to save the referenced configuration set to a MAT-file or MATLAB® script.
In the Model Explorer, in the Model Hierarchy, select Base Workspace.
In the Contents pane, right-click the name of the referenced configuration set object.
From the context menu, select Export Selected.
Specify the filename for saving the configuration set as either a MAT-file or a MATLAB script.
When you reopen the model you must load the saved configuration set, otherwise the configuration reference is unresolved. To set up your model to automatically load the configuration set object, see Callbacks for Customized Model Behavior.
If your model uses a configuration reference to specify the model configuration, you need to load the referenced configuration set from a MAT-file or MATLAB script to the base workspace.
In the Model Explorer, in the Model Hierarchy, right-click Base Workspace.
From the context menu, select Import.
Specify the filename for the saved configuration set and select OK. The configuration set object appears in the base workspace.
When you reopen the model, you must load the saved configuration set, otherwise the configuration reference is unresolved. To set up your model to automatically load the configuration set object, see Callbacks for Customized Model Behavior.