How can I use a mask parameter for variant control?

11 次查看(过去 30 天)
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 个评论
geieraffe
geieraffe 2023-6-21
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.

请先登录,再进行评论。

回答(1 个)

Tushar
Tushar 2023-12-11
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

类别

Help CenterFile Exchange 中查找有关 Subsystems 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by