| Contents | Index |
To use a configuration reference, it must point to freestanding configuration set. 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.
Click the Add Reference tool
or select Add > Configuration Reference. The Create Configuration Reference dialog box opens.
Specify the Configuration set name of the configuration set object in the base workspace to be referenced.
Click OK. If you chose to create a configuration reference without first creating a configuration set object, a dialog box opens asking if you would like to continue. If you choose:
Yes, an unresolved configuration reference is created. For more information, see Unresolved Configuration References. Follow the instructions inResolve a Configuration Reference.
No, then the configuration reference is not created. Follow the instructions inCreate a Configuration Set in the Base Workspace, and then return to step 1 above.
A new configuration reference appears in the Model Hierarchy under the selected model. The default name of the new reference is 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 unresolved configuration reference or right-click the configuration reference, and select Open from the context menu.
The Configuration Reference dialog box opens in the Dialog pane or a separate window.

Specify the Referenced configuration set to be a configuration set object already in the base workspace. If one does not exist, see Create a Configuration Set in the Base Workspace.
Click OK or Apply.
If you specified a Referenced configuration that exists in the base workspace, the Is Resolved field in the dialog box changes to yes.

After you create a configuration reference and attach it to a model, you can activate it so that it is the active configuration.
In the GUI, from the context menu of the configuration reference, select Activate.
From the API, execute setActiveConfigSet, specifying the configuration reference as the second argument.
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 (Active).

The freestanding configuration set of the active reference now provides the configuration parameters for the model.
To obtain a referenced configuration set:
In the Model Hierarchy pane, select the configuration reference, or right-click the configuration reference, and select Open from the context menu.
The Configuration Reference dialog box appears in the Dialog pane or in a separate window.

To the right of the Referenced configuration field, click Open. The Configuration Parameters dialog box opens. You can now change and apply parameter values as you would for any configuration set.
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.
From the context menu, select Export Selected.
Specify the filename for saving the configuration set as either a MAT-file or a MATLAB script.
Tip 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 Using Callback Functions. |
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.
Tip 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 Using Callback Functions. |
The Code Generation pane of the Configuration Parameters dialog box contains a Build button. Its availability depends on whether the configuration set displayed by the dialog box resides in a model or is a freestanding configuration set.
When the pane displays a configuration set stored in a model, the Build button is available. Click it to generate and compile code for the model.
When the pane displays a freestanding configuration set, the Build button is unavailable. The configuration set does not know which (if any) models link to it.
To provide the same capabilities whether a configuration set resides in a model or is freestanding, the Configuration Reference dialog box contains a Build button. This button has the same capability as its equivalent in the Configuration Parameters dialog box. It operates on the model that contains the configuration reference.
![]() | Manage a Configuration Set | About Configuration Sets | ![]() |

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 |