How to access Bus Ports parameter from action bar in Buscreator/Busselector blocks?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
When programmatically change bus selector/bus creator block to bus element port block through clicking by option from action bar "Bus Ports"? How can I programmatically do this in matlab?
for exampe from first image comment.png to access comment out parameter using get(gcbh,'commented');
same what parameter name to access busports ? --->from second image busports.png
0 Commenti
Risposte (1)
Rajanya
il 25 Set 2024
I understand that you want to access and control the ‘Bus ports’ parameter from action bar in a ‘Bus Creator/ Bus Selector’ programmatically.
The number of input ports can be initialized using the ‘Number of inputs’ parameter in a ‘Bus Creator’. The following lines of code can be used to set and get the input parameter of a ‘Bus Creator’ programmatically.
set_param(gcb,'Inputs','element1,element2,element3,element4')
get(gcbh,"Inputs")
The ‘set_param’ sets the input parameters and the incoming elements to the bus, thereby varying the number of input ports. The ‘get’ method called on the ‘current block handle’, indicated by ‘gcbh’, gives us the current number of input ports of the ‘Bus Creator’.
For more information about the parameters of a ‘Bus Creator block’, refer this documentation page: https://www.mathworks.com/help/releases/R2020b/simulink/slref/buscreator.html#mw_0b4c698d-d93d-4b10-8bca-8ae11894f317
Hope this helps!
0 Commenti
Vedere anche
Categorie
Scopri di più su Programmatic Model Editing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!