Using the Variant Manager, you can define and manage variant configurations in the following ways.
Explore, visualize, and manipulate variant hierarchy.
Define, validate, and visualize variant configurations.
Define constraints models must satisfy.
Specify the default variant.
Associate variant configuration data object of type
Define variant configurations, constraints, and export them as a variant configuration data objects.
Validate variant configurations without updating the model.
The Variant Manager enables you to specify the following information.
Variant configuration data: The variant configuration object stores a collection of variant configurations, constraints, and the default configuration.
Configuration: The configuration defines a set of variant control variables and values, referenced model configurations, and constraints that must be satisfied. Constraints are expressions that evaluate to a Boolean value.
Specify name-value pairs defined as structures having fields
Value. Simulink® verifies the values of the
control variables when validating the configuration. Variant control
variables determine the active variant.
Submodel Configurations: Specify variant configurations for models referenced by model reference blocks.
For a model or referenced model that has a variant configuration data object with a default configuration defined, the control variables from the default configuration are loaded to the base workspace and are used for validation.
When you define a configuration as the default one, any configurations you define later are superseded by the default configuration during model compilation.
For example, consider two configurations:
&& W==2) and
&& W==2). Here,
config2 is the
default configuration. If you validate your model using
config1, Simulink populates the base workspace
or data dictionary with
V = 1 and
1. However, when you compile your model,
config1. Simulink pushes
V = 1 and
= 2 to the base workspace or data dictionary, overwriting
the previous values of the variables and using
For referenced models, if the top model specifies the variant configuration, that specific variant configuration is used to validate the referenced models.
For a model containing referenced models, you can have multiple variant configurations that use common set of control variables and referenced model configurations. In such cases, all the variant configurations must have the same values for control variables and referenced model configurations.