Nested array hierarchy for signals

7 ビュー (過去 30 日間)
Ratna
Ratna 2025 年 6 月 5 日
回答済み: TED MOSBY 2025 年 6 月 5 日
I would like to create bus object with 4 level of nested bus hierechy. Is it possible to do?

回答 (1 件)

TED MOSBY
TED MOSBY 2025 年 6 月 5 日
Hi @Ratna,
Yes you can certainly nest buses to any depth. So you can build a 4-level hierarchy by defining each “leaf” bus first and then using it as an element in the next‐higher‐level bus, and so on.
You can follow the following :
  1. Define the innermost (Level 4) bus with normal signal elements.
  2. Define Level 3, including one BusElement whose DataType is 'Bus: Bus_L4'.
  3. Define Level 2, including one element 'Bus: Bus_L3'.
  4. Define Level 1, including one element 'Bus: Bus_L2'.
As a result you are gonna see a top-level bus (Bus_L1) containing nested subbuses down four levels. Once you’ve assigned all four bus definitions (Bus_L1 through Bus_L4) into the workspace, you can simply set your Inport, Outport, or Data Store’s type to Bus: Bus_L1 in Simulink and get the full nested hierarchy in your model.
Some things to keep in mind:
  • Each bus object must have a unique Name property.
  • You must create Level 4 first, then Level 3 (which references Level 4), then Level 2, then Level 1. Otherwise Simulink won’t know about the referenced bus.
  • If you pull this bus into a block (e.g., Inport), be sure to set that Inport’s “Port data type” to Bus: Bus_L1.
  • If you build a bus directly by connecting a Bus Creator with multiple inputs, Simulink can create a “virtual bus.” But for nested (hierarchical) buses, you can choose explicit Simulink.Bus definitions so you can control names and data types.
Please refer these pages to know more:
  1. https://www.mathworks.com/help/simulink/slref/buscreator.html?searchHighlight=nested+bus+heirarchy&s_tid=srchtitle_support_results_2_nested+bus+heirarchy
  2. https://www.mathworks.com/help/simulink/slref/simulink.bus.html
  3. https://www.mathworks.com/help/simulink/ug/create-bus-objects-programmatically.html
Hope this helps!

カテゴリ

Help Center および File ExchangeComposite Interfaces についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by