|On this page…|
Top level variant blocks named Controller and Plant.
The Controller block has three choices: Linear Controller, Nonlinear Controller, and Smart Controller.
The Smart Controller block references two models: slexVariantManagementAISensor1ModifierMdlRef and slexVariantManagementFLSensor1ModifierMdlRef.
The Plant block has two choices: External and Internal.
The Internal block has two choices: Experimental and Standard.
The External block references the slexVariantManagementExternalPlantMdlRef model.
You can open Variant Manager in any one of the following ways:
From the model editor, click View > Variant Manager.
In the Block Parameters dialog box of either the Controller or the Plant block, click Open block in Variant Manager.
Right-click either the Controller or the Plant block and select Variant > Open in Variant Manager.
The Variant Manager opens up as shown below. The blocks in the model have been expanded to display the complete hierarchy.
Once you have Variant Manager open for the model, you can navigate between the active, invalid, and overridden choices in the variant hierarchy.
To navigate between active variant rows, use and buttons.
To navigate between variant rows with errors, use and buttons.
To navigate between rows which represent overridden variant choices, use and buttons.
You can selectively display all hierarchical blocks or only model variant blocks. Use the options available on the Show drop down.
You can add variant configuration LinInterExp manually.
Click on the Configurations tab and enter LinInterExp in the Name column.
Click on the Control Variables tab to add the following control variables:
Validate the model using the LinInterExp configuration.
From the drop down menu, select LinInterExp configuration from the . You will see the following in the validation results pane:
You can add another variant configuration LinInterStd by importing control variables.
On the Configurations tab click and enter LinInterStd in the Name column.
Click button on the Control Variables tab, to import control variables from the workspace. These control variables are imported:
You can convert any of the existing control variables to Simulink.Parameter object using the button. You can also add or delete control variables using and buttons.
Additionally, from the Submodel Configurations tab, you can add a configuration to be used by model reference blocks. For example, for the slexVariantManagementExternalPlantMdlRef model, add the LowFid configuration as shown below:
Validate the LinInterStd configuration.
From the Validate drop down menu, select configuration . On validation, you will see the following in the results:
You can also add copy of an existing variant configuration. For example, to add a copy of the LinInterExp variant configuration, click button.
You have LinInterExp and LinInterStd variant configurations defined. For example, if you want to validate using the LinInterStd variant configuration, select the same from the drop down.
You can set one of the variant configurations as the default active configuration.
On the Configurations tab, select the LinInterExp variant configuration and click button.
Verify that the default active variant is set to LinInterExp:
You should see the following:
Name: 'LinInterExp' Description: [1x81 char] ControlVariables: [1x3 struct] SubModelConfigurations: 
Constraints are conditions that must evaluate to true for all variant configurations you define for a model. For example, you can add a constraint LinNotExtern to the example model.
Click the Constraints tab.
Enter LinNotExtern as the Name and (Ctrl~=1) || (PlantLocation ~=1) as the Condition for the constraint. For a model that has this constraint defined, you cannot create variant configurations that use the Linear Controller and External Plant Controller configuration.
To validate the constraints, click .
Before closing Variant Manager, you can save the variant configuration data.
Enter a name for the variant configuration data object in the Name field and press return.
If variant configuration data object of the specified name exists in base workspace, you will be prompted to Associate with it, else a variant configuration data object of the specified name is created and the model is associated with it.