How to create a Referenced Model Block with variable inport dimensions?

1 view (last 30 days)
I am having some severe trouble ith Simulink right now. I basically use parameterized Referenced Models for easy reusing of Model Blocks inside a larger model. However I have run into a problem:
  • Model Arguments can't be used on non-tunable parameters (like inport dimensions)
  • Variable-Sizdes signals cannot simply be created by MUXing signals together. (So using variable-sized inports is also difficult.)
  • The required dimensional information sadly gets lost at the model boundary.
A few pictures to showcase my problem:
It is easy enough to define the port dimensions inside this model. But I want this model to be reusable various dimensionalities (Maybe I want to Mux together 3 instead of 2 signals)
The math inside should be fine with any dimension and in a subsystem this should work just fine, but the model boundary makes it hard for me to create this in an easy to re-use way... . This is a problem if it comes to re-useability and modularization. This is also a topic that I would have not expected to be so difficult to implement coming from other programming languages where things like would be as easy as using a variable-length list as input.
Any tips would be appreciated.

Answers (1)

Githin George
Githin George on 7 Feb 2024
Hello Pascal,
I understand that you would like to reuse your referenced model with different settings but is not able to because of non-tunable parameters like “Inport dimension”.
This behaviour is expected and can be seen in the model-architecture-guidelines documentation link provided below.
You can see that referenced models are context-independent with a defined boundary, so they do not inherit most signal properties.
In your case, the “Subsystem Reference” block may prove to be more helpful as it can inherit the signal properties as mentioned in the documentation below.
To know more about the “Subsystem Reference” block you can go through the below documentation link.
I hope this helps.

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!