All buses combined into an array of buses must:
Be nonvirtual
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
These blocks support arrays of buses:
Virtual blocks (see Nonvirtual and Virtual Blocks)
These nonvirtual blocks:
Note
You can use an array of buses as an input to an In Bus Element block, but you cannot use that block to select individual buses. The block passes through the whole array of buses.
Using an array of buses 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 Arrays of Buses.
Block | Block Parameters Settings |
---|---|
Memory | Initial condition — You can specify this parameter with:
|
Merge |
|
Multiport Switch | Number of data ports — Set to a value of 2 or greater. |
Signal Conversion | Output — Set to
|
Switch | Threshold — Specify a scalar threshold. |
To initialize an array of buses with structure parameters, you can use:
The number 0
. In this case, all the individual
signals in the array of buses use the initial value
0
.
A scalar 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:
Field name
Numeric data type, such as single
or int32
Complexity
Dimensions
You cannot use partial structures.
For more information about specifying initial conditions for buses, see Initialize Arrays of Buses.
Simulink® software does not log arrays of buses inside referenced models in rapid accelerator mode.
Stateflow® action language does not support arrays of buses.
A Bus Creator block can accept an array of buses as input, but cannot have an array of buses as output.
After model simulation, the line style for the array of buses is a thicker version of the signal line style for a nonvirtual bus.
For example, in the sldemo_bus_arrays
model, the
Scalar Bus
signal is a nonvirtual bus, and the Bus
Array
output signal of the Concatenate block is an
array of buses.