Select signals from incoming bus
Simulink / Commonly Used Blocks
Simulink / Signal Routing
HDL Coder / Signal Routing
The Bus Selector block outputs a specified subset of the elements of the bus at its input. The block can output the specified elements as separate signals or as a new bus.
By default, Simulink® implicitly converts a nonbus signal to a bus to support connecting the
signal to a Bus Selector block. To prevent Simulink from performing that conversion, set the Non-bus signals treated as bus signals diagnostic to
warning
or error
.
When the block outputs multiple elements, it outputs each element from a separate port from top to bottom of the block. See Port Location After Rotating or Flipping for a description of the port order for various block orientations.
In the Simulink Editor, as you draw a new signal line close to output side of a Bus Selector block and all output ports are already connected, Simulink Editor:
Adds a port
Prompts you to specify the signal to be selected
You cannot use this automatic port addition approach in either of these cases if:
There is no bus input signal connected to the Bus Selector block.
You do not specify a signal in response to the prompt that appears when you draw a signal line close to the Bus Selector block icon.
You select the Output as virtual bus parameter.
For models that include buses composed of many elements, consider using the In Bus Element and Out Bus Element blocks. You can use these bus element port blocks instead of Inport with Bus Selector blocks for inputs, and Outport with Bus Creator blocks for outputs.
Bus element port blocks:
Reduce signal line complexity and clutter in a block diagram.
Make it easier to change the interface incrementally.
Allow access to a bus element closer to the point of usage, avoiding the use of a Bus Selector and Goto block configuration.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Bus Assignment | Bus Creator | Bus to Vector | Out Bus Element