For nonvirtual buses, you must use Inport and Outport blocks.
To pass a bus into a referenced model by using an Inport block, see Use Buses with Root-Level Inport Blocks.
To pass a bus out of a referenced model by using an Outport block, see Use Buses with Root-Level Outport Blocks.
To accept a bus as an input to a nonvirtual Inport block in an atomic subsystem, see Use Buses with Atomic Subsystem Nonvirtual Inport Blocks.
To pass a bus from an Inport block into a referenced model, in the Block Parameters dialog box of the Inport block:
Set the Data type parameter to
<object name> with the name of the bus
object name that defines the bus that the Inport block
Root-level Inport blocks convert virtual buses to nonvirtual buses. All signals in a nonvirtual bus must have the same sample time. For details, see Specify Bus Signal Sample Times.
For information about importing data to root-level Inport blocks, see Load Bus Data to Root-Level Input Ports.
Root-level Outport blocks convert virtual buses to nonvirtual buses. All signals in a nonvirtual bus must have the same sample time. For details, see Specify Bus Signal Sample Times.
A root level Outport block of a model can accept a virtual bus only if all elements of the bus have the same data type. The Outport block automatically converts the bus to a vector having the same number of elements as the bus, and outputs that vector.
To use a bus signal that contains mixed data types as an input to a root-level Outport block, in the Block Parameters dialog box of the Outport block:
Set Data type to
<object name> with the name of the
bus object name that defines the bus that the Outport
In a model hierarchy, if the bus signal in a top model is virtual, the signal is converted to nonvirtual (see Bus Conversion). For information about using buses as inputs to or outputs from a referenced model, see Bus Data Crossing Model Reference Boundaries.
By default, an Inport block is a virtual block and accepts a bus as input. However, an Inport block is nonvirtual if both of these conditions exist:
The Inport block is in an atomic subsystem.
The signal or any of its elements (if the signal is a bus) are directly connected to the output of the subsystem.
For information about the difference between virtual and nonvirtual blocks, see Nonvirtual and Virtual Blocks.
The Inport block can accept a bus when either of these conditions is true:
All elements of the bus can be converted to a vector (all the elements must have the same data type).
The bus is a nonvirtual bus.
If bus elements have different data types, attempting to simulate the model halts the simulation and produces an error message. You can avoid violating this condition without changing the semantics of your model by inserting a Signal Conversion block between the Inport and Outport blocks.
For example, the following model, which includes an atomic subsystem, does not simulate.
In the subsystem, the Inport block labeled
nonvirtual is nonvirtual because it resides in an atomic
subsystem and one of its bus elements (labeled
connects to a subsystem output.
Further, the bus (
bus1) connected to the subsystem inputs has
elements of differing data types. As a result, you cannot simulate this
To break the direct connection to the subsystem output, after the nonvirtual
Inport block, insert a Signal Conversion block.
Set the Signal Conversion block Output parameter
Signal copy. Inserting the Signal
Conversion block enables you to simulate the model.