Why does the connection order change in the top-level model, if I delete, add, or re-arrange input ports in a model reference?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 7 de Jun. de 2023
Respondida: MathWorks Support Team
el 16 de Jun. de 2023
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?
Respuesta aceptada
MathWorks Support Team
el 7 de Jun. de 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.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Subsystems en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!