Main Content

Modify Bus Hierarchy

To view the hierarchy of a bus, right-click on the associated signal line and click Signal Hierarchy in the context menu. You can also see the signal hierarchy in the block parameter dialog box for the Bus Creator, Bus Assignment, Bus Selector, In Bus Element, and Out Bus Element blocks.

To change the hierarchy of elements in a bus, you can:

  • Separate a bus into its constituent signals with a Bus Selector block, then reassemble the signals with one or more Bus Creator blocks.

  • For an Out Bus Element block, edit the second part of the label, which corresponds to the bus element. Suppose you have a bus element namedsignal1 and you want to move signal1 into a nested bus named NestedBus. You would change the part of the label that corresponds to the bus element from signal1 to NestedBus.signal1.

  • In the Out Bus Element block parameter dialog box, click and drag signals to different hierarchy levels.

To change the order of elements in a bus:

  • In the Bus Creator block parameter dialog box, select one signal or adjacent signals, then click the Up or Down button.

  • In the Out Bus Element block parameter dialog box, click and drag signals within their existing hierarchy level.

When you change the bus hierarchy, Simulink® automatically handles most of the complexities involved. For example, Simulink repairs broken selections in the Bus Selector and Bus Assignment block parameter dialog boxes due to upstream bus hierarchy changes. By default, the related Repair bus selections configuration parameter is set to Warn and repair. The repairs occur when you update a model.

Tip

To change the value of elements in a bus, use a Bus Assignment block. For details, see Replace Values of Bus Elements.

Resolve Circular Dependencies in Buses

Nesting buses can produce a loop of blocks where a bus is an element of itself. This circular definition cannot be resolved and therefore causes an error. To trace the loop, you can use the location cited in the error message.

  1. Select a signal line associated with the location cited in the error message.

  2. Right-click a signal and choose Highlight Signal to Source or Highlight Signal to Destination. See Highlight Signal Sources and Destinations for more information.

  3. Continue choosing signals and highlighting their sources and destinations until the loop becomes clear.

  4. Restructure the model to eliminate the circular bus definition.

Because the problem is a circular definition, rather than a circular computation, the cycle cannot be broken by inserting additional blocks. For example, you cannot fix a circular definition the way that you break an algebraic loop by inserting a Unit Delay block. You must restructure the model to eliminate the circular bus definition.

See Also

| |

Related Topics