How do I programmatically manipulate a Bus Selector in a masked subsystem?

3 vues (au cours des 30 derniers jours)
Stefan
Stefan le 6 Mar 2015
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!

Réponses (0)

Catégories

En savoir plus sur Subsystems dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by