How do I programmatically manipulate a Bus Selector in a masked subsystem?
1 view (last 30 days)
Show older comments
Hello, I want to connect a virtual bus to a masked subsystem, and have the number of outports and mask display names match the number of signals in the input bus, along with their corresponding names. Essentially, it will be a fancy enclosed Bus Selector that works automatically. The purpose for this is to simulate the functionality of a hardware-interface CANbus send message block.
I can already implement the opposite feature, where the number of inports and size of Bus Creator is set via mask dialog, inport-to-busCreator lines are programmatically connected, and the signal names are displayed on the mask when they are connected. I used get(Porthandles) to read the signal names, and find_system / set_param to set the bus creator inputs. However, a similar approach does not appear to work for me for the bus selector/outport case.
My questions are specifically:
1. I can get the Bus Selector parameters with find_system. However, the InputSignals parameter is always '[]', and the Outputsignals parameter is always the names of the signals that I last included manually. Why is this - am I missing something here?
2. I can use get(gcbh,'PortHandles') and look at the line coming out of the Inport, but again, the name is always blank, even if I make a dummy bus and directly name it before going into the subsystem. Why?
3. If I am on the wrong track, how should I be approaching this problem?
I will try to put together a minimum working example for both cases if I get a chance.
Thanks!
0 Comments
Answers (0)
See Also
Categories
Find more on Subsystems in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!