Convert Configurable Subsystem to Variant Subsystem
Note
Configurable Subsystem has been removed. Convert Configurable Subsystem blocks in existing models to Variant Subsystem blocks.
In model-based design, the ability to efficiently manage and simulate multiple design variants within a single model is important. While the Configurable Subsystem block helped simplify the creation of models that represent families of design, the Variant Subsystem blocks offers more advantages than the Configurable Subsystem block. With a Variant Subsystem block, you can:
Avoid creating a library to instantiate the Variant Subsystem block.
Control variant blocks through
label
,expression
, andsim codegen switching
modes.Include both active and inactive choices in the generated code.
Mix Model blocks and Subsystem blocks as variant choices.
Manage the nested variant subsystem workflow.
Use advanced variant management capabilities with Variant Manager.
Methods to Convert Configurable Subsystem to Variant Subsystem
You can convert a Configurable Subsystem block to a Variant Subsystem block in these ways:
Using Upgrade Advisor programmatically
Using Upgrade Advisor interactively
Using the
convertToVariantSubsystem
methodUsing the context menu of the Configurable Subsystem block
During conversion, Simulink performs the following operations:
Replaces the Subsystem block with a Variant Subsystem block, preserving ports and connections.
Adds the original subsystem as a variant choice in the Variant Subsystem block.
Sets the Variant Subsystem to label mode with the original active choice being set as the
Label mode active choice
.Preserves links to libraries. For linked subsystems, Simulink adds the linked subsystem as a variant choice.
Simulink also preserves the subsystem block masks, and it copies the masks to the variant choice.
If our model has Configurable Subsystem blocks containing parametrized links
Using Upgrade Advisor Programmatically
Use the upgradeadvisor
function to convert Configurable
Subsystem blocks in a model to Variant Subsystem blocks
programmatically.
Open a model containing a Configurable Subsystem block.
Convert the library template blocks to Variant Subsystem blocks using the
upgradeadvisor
function. Create an object forupgradeadvisor
and run theupgrade
method with theupgrader
object.upgrader = upgradeadvisor(bdroot); upgrader.upgrade
A report with the status of the block conversion is generated. For information on how to use the
upgradeadvisor
function, see Programmatically Analyze and Upgrade Model.
Using Upgrade Advisor interactively
Change Active Variant
When you convert a Configurable Subsystem to a Variant Subsystem block, Block Choice of the Configurable Subsystem block is changed to Label mode active choice in the Variant Subsystem block.
If the Block choice of the Configurable Subsystem template block is linked, then the block is copied to the Variant Subsystem and the copied blocks will have their links retained. If the Block choice of the Configurable Subsystem template block is not linked, then the block is copied to the Variant Subsystem and the block in the Configurable Subsystem library is linked to it.
To change the active variant:
Right-click the badge on the Variant Subsystem block and select Block Parameters (Subsystem). In the block parameters dialog box, select the active variant from Label Mode Active Choice drop-down list.
Right-click the badge on the Variant Subsystem block and select Label Mode Active Choice.
Note
When a Configurable Subsystem block with a mask is converted to Variant Subsystem block, the Label mode active choice option and all other parameters in block parameters dialog box are disabled. To change the active variant, right-click the badge on the Variant Subsystem block and select Label Mode Active Choice.