Model block cannot be under a non-trivial mask since the model it references has grouped model arguments.

조회 수: 16 (최근 30일)
Hello,
I have created a model with model arguments, which are grouped into a structure using a Simulink.Parameter object and a Simulink.Bus object as data type. The model arguments are stored in the model workspace and marked as arguments.
This model can be referenced from another model without any issues using a model reference block.
But if I mask the referenced model, I always get the following error during compilation:
Model block 'myModel' cannot be under a non-trivial mask since the model it references has grouped model arguments.
Do I miss some point regarding referenced models?
Thx for helping...

채택된 답변

db1024
db1024 2019년 5월 21일
The issue happens if the Simulink.Parameter object has a Storage Class other than Auto. By changing it to
myParam = Simulink.Parameter(myStruct);
myParam.CoderInfo.StorageClass = 'Auto';
the model can be referenced with a mask.
  댓글 수: 2
Paul Rancuret
Paul Rancuret 2023년 2월 6일
Is there a plan to support masking a referenced model with tunable arguments?
This is a pretty strong limitation. As soon as you set that storage class to 'Auto,' the model will then inline the parameter values when coded as a 'top model' rather than using the instance parameters.
Let's say I have a model which I intend to generate re-usable code with production intent. I intend each instance of the model to use differnet values for the parameters in the argument. In that case, I cannot use the 'Auto' storage class. Wouldn't I still want the ability to reference mutliple instances of the model in some other 'top-model' of a larger system? That seems to be one of the primary objectives of model referencing - I can instantiate the exact model intended to generate production code in some larger simulation for test purposes. Using masks at some level in the simulation/test model seems like the most maintainable/scalable way to accomplish this in all but the simplest of hierarchies.
Zouhair Mahboubi
Zouhair Mahboubi 2023년 7월 12일
I second Paul's comment here: not being able to generate code that uses "non trivial" mask model references that have tunable instance parameters is pretty limiting!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by