Cannot mask model with referenced model inside
23 views (last 30 days)
Show older comments
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 Comments
Benjamin Thompson
on 31 Jan 2022
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.
Answers (1)
See Also
Categories
Find more on Subsystems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!