I have a bus selector block which inputs a bus which was nested several times and comprises of a number of other bus objects. I need to programmatically select a couple of bus objects from this nested bunch of busses which are of a specific bus object type. What is the best way to do it? Should I figure out the way of tracing elements of the nested bus back to the original output ports which generated these elemsnts, or is there a better and simpler way? I would like to avoid compiling the model if possible.
Here is a good example:
Suppose all the inputs are connected outside of this subsystem boundary to sources which generate data as busses. So, motor1, motor2, ... are actually busses themselves. Suppose they were defined as bus objects in workspace which are named 'Motor1BusType', 'Motor2BusType', etc. Now I want to replace Out1 block with a bus selector and programmatically (without opening dialog and tracing signals in it) configure it to output two busses which were originally defined by sources of signals of type 'Motor1BusType' and 'Motor4BusType'. Visually it is easy to see that on the bus selector I would need to pick 'Bus1.Bus2.motor1' and 'Bus1.Bus2.Bus3.motor4', but programmatically I only have the data types information available ( 'Motor1BusType' and 'Motor4BusType').
Any suggestions on how to approach it? Thanks