Clear Filters
Clear Filters

How can I use a mask parameter for variant control?

4 views (last 30 days)
I have a masked subsystem, which contains a variant subsystem.
It's out of an user implemented library, however, all library links are broken.
The problem is my mask parameter which should control the variant subsystem can not be resolved:
I tried to create a minimal example, but build from scratch the same parameter resolves and controls the subsystem without problems.
Also the original system seems to work, if I delete all mask parameters except the one which controls the variant subsystem.
Due to the complex system it is no solution to build the system again from scratch and the error also occurs if build the variant subsystem new, and copy all other blocks and the mask.
  1 Comment
geieraffe
geieraffe on 21 Jun 2023
For now, I solved it by switching to label controled subsystems.
So I can propmote to the superordinated mask.
But now I can't change the subsystems over the whole model, by just changing a variable in my workspace.

Sign in to comment.

Answers (1)

Tushar
Tushar on 11 Dec 2023
Hi,
I understand that you want to control a Variant Subsystem using mask parameters in Simulink. To add mask parameters, you need to navigate to the Mask Editor of the Variant Subsystem block. Access the “Parameters & Dialogtab to add the required parameters that will control the variant selection.
For implementing the variant control logic, go to the “Code” tab within the Mask Editor. Write the initialization code which sets the variant choice that is passed from the mask dialog box.
The below example shows how to configure and use a Variant Subsystem block in Simulink.
Here is an example demonstrating the use of a masked Variant Subsystem block, including the process of adding parameters in the mask dialog box, and implementing initialization logic for variant selection.
For more information on label modes in Variant Blocks, such as ‘LabelModeActiveChoice’, see the below documentation.
I hope the resources are useful in resolving the issue you are facing.
Best,
Tushar

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!