Format position of inports and referenced subsytem naming in simulink

Hi All
I'm trying to create my own simulink blocks, and I was wondering how I can format the distance between the referenced subsystem name and the in-/output ports. See example below. When I 'shorten' the block then the naming of the inport will be clashing with the naming of the referenced subsystem name. Is it possible to set a height before the in/-outport naming is allowed to start. So eg. the first 10mm from the top. I'm asking this because I want to display subsystems as small as possible in order to get a better overview on more complex subsystems.
Could you please explain it 'for dummies' as I am a starter/learner within Simulink/MatLab and are still struggling to find things. Thank you already for any answers.
Regards,
Ludo

 Accepted Answer

Presently, there is no feature in Simulink to set a specific height before the inport/outport naming starts.
One workaround you could use if you want your blocks to be as small as possible, without the names clashing is to remove the name of the block from inside the block.
You could refer the block using the automatic names such as the "Subsystem Reference" written in Blue under the block. Automatic names only comes when you hover over the block.

4 Comments

Hi Sahas
Thanks for your reply. Is there a way then to remove the naming within the block? (The 'black' naming within my example). If this would not be present, then the rest would be OK. The screenshot is taken from a library that I'm trying to create were I have added it as a 'SubSystem Reference'. The naming what you see is the 'filename.slx' which is referenced and is automatically added to the block.
With kind regards
Ludo
Apologies for the late reply.
As you mentioned that you are taking the block from a library, there is no method to remove the "subsystem file name". It will always be there with the block.
One thing, you can do is reposition the ports to the bottom edge to avooid name clashes.
Hi Sahas
I also have 'played around'. A 'solution' to remove the 'SubSystem file name' from the view is to create a mask with an 'empty' icon. This can be done in the drawing commands by selecting the disp() command and then clear the string information. Make sure that in the 'property editor' the 'Icon Transparency' is set to 'Opaque with Ports'. In this way you will only have the in-/outport labels visible. This works for me as I match the naming in my library with the file naming.
Hope that this will be helpfull for others.
Cheers
Ludo

Sign in to comment.

More Answers (1)

As mentioned the comment in Sahas his answer, a workaround is to create an 'empty' icon mask. In this way only the in-/outports will be visible.

Products

Release

R2022b

Community Treasure Hunt

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

Start Hunting!