How can I use a mask parameter for variant control?

조회 수: 14 (최근 30일)
Phab
Phab 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
Phab
Phab 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에서 Component-Based Modeling에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by