How can I use a mask parameter for variant control?

9 ビュー (過去 30 日間)
geieraffe
geieraffe 2023 年 5 月 31 日
回答済み: Tushar 2023 年 12 月 11 日
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 Center および File ExchangeSubsystems についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by