1
votes

In my model I've a Delay block (see image below) connected with other blocks (not shown in the image). I have handles of each of the three ports of the Delay block, but I do not know which handle belongs to which port. Is there a programmatic way to get the "name" of the ports (e.g. Getting the values u, d and x0)?

I have access to the block's handle and handles of the three ports as well.

Please note that the labels u, d and x0 as shown in the picture are provided by Simulink, not me. And I do not want to put custom labels/tags to the ports.

enter image description here

1
Try get(port_handle) in the interactive REPL, you'll get a list of all the attributes. - Ben Voigt
@BenVoigt Thanks. I could not find it using your approach. - Shafiul

1 Answers

0
votes

try

get(find_system(gcb,'FindAll','On','SearchDepth',1,'BlockType','Inport'),'Name');

This will give you port names of Subsystem.

Instead of gcb you can put your subsystem path 'ModelName/SubsystemName'