Tracing signal with script

11 views (last 30 days)
Hammad
Hammad on 29 Apr 2020
Commented: Wei on 28 Mar 2024
I am trying to trace output signals of one subsystem ('mySubsystem' for example) to see in which other subsystems those output signals are used. I tried using PortConnectivity to find the destination block but it stops if there is a bus involved in signal tracing and gives that bus block as destination. If I use 'Highlight signal to Destination', it highlights the signal till the final place of use of that signal and does not stop at bus or outport. I am looking to get similar output with my script. Thanks!
Here is the example script i am using which does not give the final destination but stops at first bus/outport it sees.
PortCon=get_param(mySubsystem,'PortConnectivity')
DstBlock=getfullname(PortCon(2).DstBlock) %for getting DstBlock for port 2 signal

Answers (1)

Le Wang
Le Wang on 16 Dec 2020
Hi Muhammad,
The 'PortConnectivity' only leads you to the next immediate port the original port is connecting with. This is why it stops at the bus block instead of the real destination.
The 'Highlight signal to Destination' feature involves more complicated searching algorithm under the hood. The development teams are aware of this request. Signal tracing command-line API is under development and will be shipped in future release.
  3 Comments
Le Wang
Le Wang on 12 Aug 2021
Hi,
This feature will be shipped in MATLAB 2021b.
Thanks,
Le
Wei
Wei on 28 Mar 2024
the function introduced in r21b is sltrace

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!