addComponentConfiguration
Associate top-model variant configuration with variant configuration of referenced model
Since R2022b
Description
Add-On Required: This feature requires the Variant Manager for Simulink add-on.
Consider a variant model that has predefined variant configurations and also has a referenced model in its model hierarchy. In Variant Manager, a variant configuration for a top-level model must also define the variant control variables used by any referenced components in the model hierarchy, such as referenced models. If the referenced component defines its own variant configurations, you can use them to set up the control variables in the top-level configuration.
Use the addComponentConfiguration function to associate a variant
configuration of the referenced model with a variant configuration of the top-level model.
This operation adds the control variables present in the specified component configuration to
the top-level model configuration. This function thus allows you to author a top-model
configuration using referenced component configurations. For more information on this
workflow, see Compose Variant Configurations and Constraints for Top Model Using Referenced Component Configurations.
addComponentConfiguration(
associates the variant configuration vcdTop,ConfigurationName=topConfig,ComponentName=refMdl,ComponentConfigurationName=refConfig)refConfig of the referenced model
refMdl with the top-level variant configuration
topConfig that is present in the variant configuration data object
vcdTop.
This operation populates topConfig with variant control variables
from refConfig. That is, topConfig contains all
variant control variables that are in refConfig, these variables are
set to the same values as in refConfig, and they are also marked as
read-only in the top-level configuration. You cannot modify or remove the control variables
populated using a component configuration from the top-model configuration. To populate
variant control variables, refMdl is loaded. The operation also checks
that there are no conflicts in existing variant control variable definitions of
topConfig if it is associated with other referenced model
configurations.