- 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
조회 수: 7 (최근 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!