The following blocks support arrays of buses:
Virtual blocks (see Virtual Blocks)
These nonvirtual blocks:
Two-Way Connection (a Simscape™ block)
The following table describes the block parameter settings for blocks that support arrays of buses. This information is also in the reference pages for each of these blocks.
For usage information for bus-related blocks, see Arrays of Buses with Bus-Related Blocks.
|Block||Block Parameters Settings|
Initial condition — Only this parameter (which may be, but does not have to be, a structure) is scalar-expanded to match the dimensions of the array of buses.
Number of data ports — Set to a value of 2 or greater.
Output — Set to
Threshold — Specify a scalar threshold.
To select a signal within an array of buses:
Use a Selector block to find the appropriate bus within the array of buses.
Use a Bus Selector block to select the signal.
To assign a value to a signal within an array of buses:
Use a Bus Assignment block to assign a value to a bus element.
Use the Assignment block to assign the bus to the array of buses.
Bus Selector and Bus Assignment blocks can only accept scalar buses, not arrays of buses.
A Bus Creator block can accept an array of buses as input, but cannot have an array of buses as output.
For details, see Set Up a Model to Use Arrays of Buses.
Setting up a model to use an array of buses usually involves basic tasks similar to these:
Define the array of buses (see Define an Array of Buses).
Add a subsystem for performing iterative processing on each element of the array of buses. For example, use a For Each Subsystem block or an Iterator block.
Connect the array of buses signal from the Concatenate block to the iterative processing subsystem.
Model your scalar algorithm within the iterative processing subsystem (for example, a For Each subsystem).
Operate on the array of buses (using Selector and Assignment blocks).
Use the Bus Selector and Bus Assignment blocks to select elements from, or assign elements to, a scalar bus within the subsystem.
Optionally, import or log array of buses data.
The resulting model includes these components.
Before you run a simulation on a model that uses an array of
buses, in the Configuration Parameters > Diagnostics > Connectivity pane, check that the Mux blocks used to create
bus signals parameter uses the default setting of
After you create an array of buses and update the diagram, the line style for the array of buses signal is a thicker version of the signal line style for a nonvirtual bus signal.
For example, in the
Scalar Bus signal is a nonvirtual bus signal,
Bus Array output signal of the Concatenate
block is an array of buses signal.