- Create a Custom Library for Simulink containing the Subsystem.
- Copy the subsystem from the Custom Library to the required Simulink model.
- Go to ‘Subsystem Block’ and under the ‘Library Link’ subsection and click on Disable Link.
- When you want to reset the subsystem to its default state you can click on Restore Link and Simulink will make a fresh copy of the Subsystem taking the library subsystem as the reference.
How To Reset Dragged Port Order
12 次查看(过去 30 天)
显示 更早的评论
Hi all and thanks in advance. With 2020a, one can drag a subsystem or reference model's ports around to make the lines easier to understand, without updating the child system's port numbers. It used to be that you would have to change the child's port number to get the parent model to show a new port order. I cannot find a good pic or video showing it but it is similar in style to this Matwork's video https://www.youtube.com/watch?v=gwq0Ufohkhc
I run a script that pulls the port info from the block but I have changed the port order by dragging it around. As such, I have broken the script as the order returned is the order the ports were created in the child model and not the order as they appear on the top level model. How do I reset the parent model's port ordering back to what the child's number shows?
0 个评论
回答(1 个)
Animesh
2023-8-31
I understand that you want to reset the port order for a subsystem, but it is currently not possible to restore the subsystem its original state without a reference subsystem.
To remedy the lack of reference for the subsystem you can try following the below mentioned steps :-
To read more about Custom Libraries, please refer to the following documentation :- https://www.mathworks.com/help/simulink/ug/creating-block-libraries.html
3 个评论
Andrea Amorosi
2024-1-17
I'm facing the same issue.
Is it possible to disable this dragging feature so that the order of port is always defined by the port number of the called subsystem?
Andrea Amorosi
2024-1-17
I've seen that exist the reset ports button inside the Format tab.
The button appears when a subsytem reference or a referenced model is selected and it is active if that instance has some dragged ports.
Is it possible to programmatically check if a selected instance of a model has dragged ports?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!