How can I use a mask parameter for variant control?
Show older comments
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.
Answers (1)
Tushar
on 11 Dec 2023
0 votes
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 & Dialog” tab 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
Categories
Find more on Subsystems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!