Main Content

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 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, and sim 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 method

  • Using 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.

  • Overrides the Variant Subsystem block to use the subsystem that was originally the 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.

  1. Open a model containing a Configurable Subsystem block.

  2. Convert the library template blocks to Variant Subsystem blocks using the upgradeadvisor function. Create an object for upgradeadvisor and run the upgrade method with the upgrader 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

 Using convertToVariantSubsystem Method

 Using Context Menu of Configurable Subsystem Block

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.

See Also

Related Topics