Select input from external port
Simulink / Ports & Subsystems
Simulink / Sources
HDL Coder / Ports & Subsystems
HDL Coder / Sources
The In Bus Element block, also known as the Bus Element In block, combines the functionality of an Inport block and a Bus Selector block. This block is of the Inport block type and all In Bus Element blocks that use the same port share a Block Parameters dialog box.
You can use an In Bus Element block to select a bus element, bus, nonbus signal, or message associated with the port. To select multiple elements from a bus, use multiple In Bus Element blocks.
When you insert an In Bus Element block, the block label populates with default values. The label consists of two interactive text fields: the port name and the bus element. To change the name of the port associated with the block, edit the first text field in the label by clicking in it.
To create related In Bus Element blocks, in the Block Parameters
dialog box, you can select the Add blocks for selected
signals
button.
If multiple blocks are associated with the same port and you change the name of the port, all blocks that share the port update to reflect the new port name.
You can create additional ports by holding Ctrl while you drag an existing In Bus Element block to a new location. Upon releasing the mouse, you have the option to create a port or use the existing port associated with the block being copied.
You can view the elements associated with a port in the Block Parameters dialog box for any of the related In Bus Element blocks.
Black element names are already associated with an In Bus Element block. Grey element names are available, but are not being used. Red element names are not available in the input bus, despite being specified by an In Bus Element block.
You can create In Bus Element blocks for each selected element by
clicking the Add blocks for selected signals button .
To remove blocks associated with selected elements, such as elements which are
unavailable in the input bus, click the Remove blocks of selected
signals button .
To change the bus element associated with the block, edit the second text field in the label by clicking in it.
If a bus is connected to the port, you can select an element of the bus from the list that appears. To see all elements of the bus along with the previously specified element name, clear the text. The list of elements is filtered to include only the elements that contain the existing text.
Each dot in the part of the label that describes the bus element indicates a new level of bus hierarchy. To reduce the size of the label, you can display only the element name by selecting the block, pausing over the ellipsis, and selecting Compact Notation from the action bar. To show the bus hierarchy again, select Expanded Notation from the action bar.
You can pass through the entire input connected to the port, including nonbus signals, by deleting the text from the second text field.
Referenced models support passing through an entire bus with an In Bus Element block in either of these scenarios:
The bus is defined by a Simulink.Bus
object.
Additional In Bus Element blocks pass each leaf element of the bus into the referenced model.
You can select an In Bus Element block that has duplicates to highlight the duplicate blocks.
You can use an In Bus Element block to load external input data for
a bus. An In Bus Element block can load data for an element of a bus
or for an entire bus. When you use an In Bus Element block to load
data for an entire bus, you must specify the data type for the block using a Simulink.Bus
object. For more
information about loading input data for bus elements, see Load Input Data for a Bus Using In Bus Element Blocks.
You can load simulation input data for a group of root-level In Bus
Element blocks by using a structure of timeseries
,
timetable
, or SimulationDatastore
objects.
In Bus Element blocks interpolate loaded data for all data types
except string
, enumerated
, and fixed
point
.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|