For a parent variant + referenced subsystem with a child variant subsystem, can I have the variant control choice for the children be unique for each referenced parent?

15 views (last 30 days)
Hi,
I have a parent variant subsystem with 2 choices. This is also a referenced subsystem and is used in 3 instances, let's name them: A, B and C.
Within each parent there is a child variant subsystem with also two choices, ie. Parent_A -> Parent_A_Choice_X -> Child -> Child_Choice_Y
, where X is the variant choice for the parent subsystem and Y is the variant choice for the child subsystem.
My isssue is, that when I define the variant choice conditions (I do this in expression mode) for one of the children, the choice propagates to all the referenced parent subsystems A, B and C. The functionality I would like is that I can choose unique expressions for the children in each of the parent subsystems.
Is there any way to do this?
Best regards,
Emil Munk

Accepted Answer

Emil Plovmand
Emil Plovmand on 8 Jan 2025
Please disregard Arjun's responses as I believe they are AI generated.
I found a solution to the issue on my own. First off: I believe that what I ask in my question can not be achieved using referenced subsystems. But it is possible to do it using referenced models instead. I found this article which paved the way for me: Configure Instance-Specific Values for Block Parameters in a Referenced Model
So what I did was convert my referenced subsystems to referenced models, and then defined Simulink parameters in the Model Workspace to be used for choosing the variant. You need to tick off the 'Argument' box, which allows the parameters to be defined instance specifically. Remember to type default parameters, Then, the parameters can be modified in each instance of the referenced parent subsystem through the Model Data Editor. Note that this approach needs the 'variant activation time' to be on startup.

More Answers (0)

Categories

Find more on Component-Based Modeling in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!