Replace specified bus elements
Simulink / Signal Routing
HDL Coder / Signal Routing
The Bus Assignment block assigns the values of an input element to bus elements. Use a Bus Assignment block to change bus element values without adding Bus Selector and Bus Creator blocks that select bus elements and reassemble them into a bus.
Connect the bus to the first input port. To other input ports, connect one or more elements whose values you want to assign to a bus element. Use the Block Parameters dialog box to specify the bus elements to be replaced. The block displays an assignment input port for each such element. For an example of a model that uses a Bus Assignment block, see Replace Values of Bus Elements.
By default, Simulink® repairs broken selections in the Bus Assignment Block
Parameters dialog boxes that are due to upstream bus hierarchy changes. Simulink generates a warning to highlight that it modified the model. To prevent
Simulink from making these repairs automatically, in the Model Configuration Parameters > Diagnostics > Connectivity pane, set the Repair bus selections diagnostic to
Error without repair
.
When using arrays of buses with a Bus Assignment block, these limitations apply:
You can assign or replace a nested bus that is an array of buses. For a bus that is nested inside an array of buses, see Assign into Arrays of Buses.
To replace an element in an array of buses, use a Selector block to select the index for the bus element that you want to use with the Bus Assignment block. Then, use that selected bus element with the Bus Assignment block.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|