Why does the connection order change in the top-level model, if I delete, add, or re-arrange input ports in a model reference?

6 vues (au cours des 30 derniers jours)
I start with the below model that includes 3 input ports connected to a child model reference. 
Now, I add a port called "new" inside the child model.
After refreshing the model in the top-view, the ports shift on the child model and are now mismatched (shown below).
              
I would expect the ports to update like a linked library or normal subsystem. For example when you swap ports 2 and 3 inside the linked library, in the model below, and go back to the top-level, the input ports are still connected to the corresponding port on the linked library. 
  
This behavior in the model reference is not very intuitive. This also happens with subsystem reference.
Is this expected behavior and is there any workaround to this?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 7 Juin 2023
The behavior you described is expected behavior as of MATLAB R2023a, and a result of the different uses that subsystems and referenced subsystems commonly serve.
As a workaround, in Model configurations, please enable the 'Port and parameter mismatch' diagnostic to error, so that you are aware of any changes in parameter connections from a model reference. This will prevent accidental changes in referenced model IO to propagate to the parent model. For releases after MATLAB R2020a, the error includes a "Fix-it" button, with suggestions for correcting the mismatches. 

Plus de réponses (0)

Catégories

En savoir plus sur Subsystems dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by