All buses combined into an array of buses must:
Have the same bus type (that is, same name, hierarchies, and attributes for the bus elements)
Have no variable-size signals or frame-based signals
You can use arrays of buses with these blocks:
Several nonvirtual blocks, such as:
Some signal routing blocks (for example, Data Store Memory, Merge, and Switch)
Rate Transition and Zero-Order Hold blocks
Several additional blocks, such as Assignment, MATLAB Function, and Signal Conversion
For a complete list, see Blocks That Support Arrays of Buses. That section describes requirements for using the supported blocks.
To initialize an array of buses with structure parameters, you can use:
0. In this case, all
the individual signals in the array of buses use the initial value
struct that represents
the same hierarchy of fields and field names as the bus type. In this
case, the scalar structure expands to initialize each of the individual
signals in the array of buses.
An array of structures that specifies an initial value for each of the individual signals in the array of buses.
If you use an array of structures, all the structures in the array must have the same hierarchy of fields. Each field in the hierarchy must have the same characteristics across the array:
Numeric data type, such as
You cannot use partial structures.
For more information about specifying initial conditions for bus signals, see Initialize Arrays of Buses.
Simulink® does not log array of buses signals inside referenced models in rapid accelerator mode.
Stateflow® action language does not support arrays of buses.
The following blocks support arrays of buses:
Virtual blocks (see Nonvirtual and Virtual Blocks)
These nonvirtual blocks:
Two-Way Connection (a Simscape™ block)
Using an array of buses signal with some blocks requires specific block parameter settings.
This information is also in the reference pages for each of these blocks. For usage information for bus-related blocks, see Work with Array of Buses Signals.
|Block||Block Parameters Settings|
Initial condition — You can specify this parameter with:
Number of data ports — Set to a value of 2 or greater.
Output — Set to
Threshold — Specify a scalar threshold.
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 model simulation, 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.