Group signals or messages to reduce model complexity at component interfaces
To reduce model complexity, group individual signals or messages into composite lines using buses.
Virtual buses meet most modeling requirements for composite interfaces and provide the flexibility to combine different types of signals.
For a comparison of modeling techniques, see Composite Interface Guidelines.
Bus Element Ports
|In Bus Element||Select input from external port|
|Out Bus Element||Specify output that connects to external port|
|Bus Assignment||Assign new values to specified bus elements|
|Bus Creator||Create bus from input elements|
|Bus Selector||Select elements from incoming bus|
|Demux||Extract and output elements of virtual vector signal|
|Mux||Combine input signals of same data type and complexity into virtual vector|
|Selector||Select input elements from vector, matrix, or multidimensional signal|
|Vector Concatenate||Concatenate input vectors of same data type for iterative processing|
|Matrix Concatenate||Concatenate input matrices of same data type for iterative processing|
|Bus to Vector||Convert virtual bus to vector|
|Signal Conversion||Convert signal to new type without altering signal values|
Bus Element Ports
|Number of leaf elements in |
|Leaf elements in |
|Specify properties of buses|
|Specify properties of elements of buses|
|Convert cell array containing bus information to |
MATLAB Structures from Buses
|Create MATLAB structures that use the same hierarchy and attributes as buses|
|Convert virtual bus signals into vector signals by adding Bus to Vector blocks|
|Type Editor||Create, modify, and manage types, such as bus objects|
Composite Interface Basics
- Composite Interface Guidelines
Combine signals, messages, or connections to simplify model appearance.
- Bus-Capable Blocks
Identify the blocks that support virtual buses, nonvirtual buses, and arrays of buses.
Visually Group Lines
- Group Signals or Messages into Virtual Buses
Create buses to reduce the number of lines in a block diagram.
- Simplify Subsystem and Model Interfaces with Bus Element Ports
Group multiple lines into a bus at the input or output of a model component.
- Display Bus Information
Display information about buses, such as signal hierarchy and whether the bus is virtual or nonvirtual.
- Identify Automatic Bus Conversions
Recognize modeling patterns that cause hidden Bus To Vector and Signal Conversion blocks.
- Programmatically Create Bus Element Ports
Add blocks for bus element ports and specify element attributes using MATLAB® functions.
Modify and Configure Buses
- Modify Bus Hierarchy
Change the order and hierarchy of nested buses and their elements.
- Assign Signal Values to Bus Elements
Use a Bus Assignment block to replace signals assigned to bus elements.
- Specify Initial Conditions for Bus Elements
Specify bus element values as initial conditions for buses.
- Share and Reuse Bus-Routing Blocks
Share blocks that create or interact with buses using subsystem references or custom libraries.
Define Bus Object Data Types
- Specify Bus Properties with Simulink.Bus Object Data Types
Simulink.Busobject uses and implementation.
- Programmatically Create Simulink Bus Objects
Use functions to create
Simulink.Busobjects from other objects, blocks, or MATLAB data.
Functionally Group Lines
- Create Nonvirtual Buses
Create buses that appear in generated code and support modeling constructs such as arrays of buses.
- Modify Sample Times for Nonvirtual Buses
Make the sample time of signals the same so that you can group them in a nonvirtual bus.
- Generate Code for Nonvirtual Buses
Use a structure in code generation to represent a nonvirtual bus. Control data types of initial condition structure fields.
- Inspect Generated Code for Nonvirtual Buses
Find nonvirtual buses in generated code for a simple model.
Simplify Iterative Processing
- Group Nonvirtual Buses in Arrays of Buses
Streamline a model for iterative processing by combining nonvirtual buses that have the same data type into an array.
- Work with Arrays of Buses
Set up your model to use an array of buses to select signals, assign values to a signal, perform iterative processing, log and load signals, and initialize signals.
- Iteratively Process Nonvirtual Buses with Arrays of Buses
Update a model to use arrays of buses to apply the same algorithm to multiple nonvirtual buses with the same data type.