Why bus creater (non-virtual) accepts elements according to order defined in Simulink.Bus object
Ältere Kommentare anzeigen
I am using Matlab R2015b.
When I create a non-virtual bus using Bus Creator, input signals (with signal names same as bus element name) to bus creator must be in order defined in Simulink.Bus object. If order is not followed then simulink throws error.
Buses are generally equivalent to structure in C. So it should be possible to refer the bus elements with names only provided that signal names are same as element name.
But why its depend on sequence of elements defined in Simulink.Bus object ??
1 Kommentar
TAB
am 8 Mai 2018
Still looking for Answer..!!
Antworten (1)
Ralf
am 26 Apr. 2018
0 Stimmen
I've got the same question.
In addition, is there a way to assemble a non-virtual bus without beeing forced to respect the order of the elements in bus object?
3 Kommentare
TAB
am 26 Apr. 2018
One alternative is there. You can use Bus Assignment block.
For this you have to first create the Non virtual bus using default values and then fed the actual signal values using Bus Assignment block. This block is very flexible. You can assing few elements or all elements at once.
Ralf
am 2 Mai 2018
Thank you very much.
That seems to be a good solution.
Chuck Olosky
am 9 Dez. 2021
For the default bus signal, you can use a constant block with a value of Simulink.Bus.createMATLABStruct('BUS_OBJ_NAME') and a data type of Bus: BUS_OBJ_NAME. Then feed this into the Bus Assignment block without needing to use a Bus Creator block.
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!