I am trying to write a script that will list out all elements on a bus that are consumed within a model. To do this, I used find_system to find all the bus selector blocks. I was able to get all the elements being selected. I am assuming buses are inputs to the model and aren't created and read from within the same model. To trace from the bus selector back to the input port, I was using:
portC= get_param(busSelectors(i),'PortConnectivity');
busSelSrc = portC{1}.SrcBlock;
However, 'From' blocks only appear to have DestBlock field filled in and source is empty. I'm not sure how to trace 'From' -> 'Goto' block from a script.
Here is an example output where CL_e2a_sl is model name. aiAD is bus name and signal impact_press_sel from that bus is getting read in that model.
****************************
Processing: CL_e2a_sl
aiAD.impact_press_sel
aiPF.body_lat_accel_compl_filt_e4
aiSM.along_track_accel_sel
aiSM.cross_track_accel_sel
******************
I am using Matlab2017a right now if that helps.