MATLAB Answers

0

Get signal name at inport of subsystem

Asked by Jes Jensen on 20 May 2019
Latest activity Answered by Fangjun Jiang on 20 May 2019
Hi,
I would like a subsystem to know the name of its input so that it can be used for a custom logging solution. I expect a callback on the subsystem which defines a variable could be one way to realize it. I just can't figure out how the callback should obtain the name.
Here is an illustration from the top level:
Capture.PNG
And how I would get the value from the callback.
in_subsys.PNG
Do you have any ideas how the callback would look?

  0 Comments

Sign in to comment.

Products


Release

R2019a

1 Answer

Answer by Fangjun Jiang on 20 May 2019
 Accepted Answer

The first case truely has the signal name. You can get it like below. In second case, you need to get the name of the Constant.
ph=get_param(SysBlockPath,'PortHandles');
sp=ph.Inport(1);
SignalName=get(sp,'Name');

  0 Comments

Sign in to comment.