Cannot mask model with referenced model inside
조회 수: 23 (최근 30일)
이전 댓글 표시
Hi, I'm not sure if my problem is unexpected or if I am missing something fundamental about creating structured models with referenced models.
Step to reproduce:
- create a model, just an identity model that sends the input directly to one output port is good enough. This would be the child model, which could possibly have parameters and a mask itself
- create an outer model which uses the model block to reference the previously created model
Now, if I try to add some simulink parameters to the model and create a mask for the outer model, I get an error window with the following message (repeated for every parameter I have added):
- Error evaluating properties of Simulink.Parameter object 'x' in workspace 'outermodel' (used by block 'outermodel/Model Mask') Unable to use model argument 'x' as an interface when model 'outerblock' is being compiled as a top model.
The error disappear if I don't use a referenced model, which isn't intuitive for me..
Any idea on what am I getting wrong?
댓글 수: 2
Benjamin Thompson
2022년 1월 31일
Can you post an example model showing the problem? Note that masking hides the base workspace or top model dictionary from any reference models within the masked subsystem. Otherwise if you have more than one instance of a reference model in a masked subsystem, how is Simulink going to know which instance gets which parameters? So the mask is supposed to be the only way that you pass parameters into a masked subsystem.
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subsystems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!