Bus Selector
Select elements from incoming bus
Libraries:
Simulink /
Commonly Used Blocks
Simulink /
Signal Routing
HDL Coder /
Signal Routing
Description
The Bus Selector block outputs the elements you select from the input bus. The block can output the selected elements separately or in a new virtual bus.
The Bus Selector block does not support mixing message and signal elements as outputs.
Ports
Input
Port_1 — Input virtual or nonvirtual bus
bus
The input virtual or nonvirtual bus contains the elements to be selected.
For arrays of buses, use a Selector block to select the bus that you want to use with the Bus Selector block.
Data Types: single
| double
| half
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| string
| Boolean
| fixed point
| enumerated
| bus
Complex Number Support: Yes
Output
Port_1 — Selected elements of input bus
scalar | vector | matrix | array | bus
By default, the block outputs each of the selected elements from a separate output port that is labeled with the corresponding bus element name. When the Output as virtual bus parameter is enabled, the block outputs the selected elements from one port, grouped in a virtual bus.
Data Types: single
| double
| half
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| string
| Boolean
| fixed point
| enumerated
| bus
Complex Number Support: Yes
Parameters
To interactively edit the block parameters, double-click the block.
Elements in the bus — List of elements in input bus
list of element names
This parameter is read-only.
The list of input elements includes all elements that enter the block, including the elements of nested buses. An arrow next to an element indicates that an input element is a bus. To display the contents of that bus, click the arrow.
To highlight the source of an element that enters the block, select the element in the list and click Find.
If you change an element name while the dialog box is open, click Refresh to update the name in the list.
Programmatic Use
Block Parameter:
InputSignals |
Type: cell array |
Values: element names |
Filter by name — Search term for filtering displayed input elements
text
To filter the displayed input elements, enter a search term. The filter does a partial-string search. Do not enclose the search term in quotation marks.
To access the filtering options, click the Show filtering
options
button to the right of the Filter by name
box.
Enable regular expression — Option to filter displayed input elements by regular expression
off
(default) | on
Select this parameter to filter the displayed input elements with either regular expressions or partial search strings. By default, you can filter the displayed input elements with only partial search strings.
Regular expressions let you filter based on whether the input elements match a
pattern. For example, enter t$
in the Filter by
name box to display all elements whose names end with a lowercase
t
(and their immediate parents). For more informations, see Regular Expressions.
Dependencies
To access this parameter, click the Show filtering options
button on the right side of the Filter by
name box.
Show filtered results as a flat list — Option to display filtered results as a flat list
off
(default) | on
Select this parameter to display filtered results as a flat list that uses dot notation to reflect the bus hierarchy. By default, the filtered results appear in a hierarchical tree.
Dependencies
To access this parameter, click the Show filtering options
button on the right side of the Filter by
name box.
Selected elements — Selected elements of input bus
list of elements names
Each element in this list is included in the block output.
To add elements to the block output:
Select one or more elements from the Elements in the bus list.
If you select multiple elements from the Elements in the bus list, the order in which you select them sets their order in the Selected elements list.
Optionally, specify where you want the elements to appear in the Selected elements list. Select the element below which you want the added elements to appear. If you do not select an element, added elements appear at the end of the list.
Click Select.
Alternatively, in the Simulink® Editor, draw a new line close to the output side of the Bus Selector block when the input port receives a bus and all output ports connect to other ports. Simulink prompts you to specify an element to select and adds a port for the element you specify. You cannot create ports in this way when Output as virtual bus is selected.
To change the order of the output elements, select an element or multiple contiguous elements in the list, then click Up or Down. Port connectivity is maintained when you change the element order.
To remove elements from the block output, select the elements in the list, then click Remove.
If an element in the list is not in the input bus, the element name starts with three
question marks (???
). Modify the input bus to include an element of
the specified name or remove the element from the list.
Limitations
To avoid a recursion limit, select fewer than 500 elements per Bus Selector block.
Programmatic Use
Block Parameter:
OutputSignals |
Type: character vector |
Values: character vector in the
form of 'signal1,signal2' |
Default: none |
Output as virtual bus — Option to output selected elements as virtual bus
off
(default) | on
By default, the block outputs each of the selected elements from a separate output port that is labeled with the corresponding bus element name. Select this parameter to output the selected elements from one port, grouped in a virtual bus.
To convert the output to a nonvirtual bus, insert a Signal Conversion block after the Bus Selector block. Set the
Signal Conversion block Output parameter to
Nonvirtual bus
and set the Data type
to a Simulink.Bus
object.
When the Selected elements list includes only one element and you enable Output as virtual bus, then that element is not wrapped in a bus. For example, if the element is a bus, the output element is that bus. If the element is not a bus, the output element is not a bus.
Programmatic Use
Block Parameter:
OutputAsBus |
Type: character vector |
Values:
'on' | 'off' |
Default:
'off' |
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Tips
For buses at subsystem and model interfaces, you can use In Bus Element blocks instead of an Inport block with a Bus Selector block. In Bus Element blocks:
Reduce 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.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Actual data type or capability support depends on block implementation.
HDL Code Generation
Generate Verilog and VHDL code for FPGA and ASIC designs using HDL Coder™.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
To learn more about using buses for HDL code generation, see Buses (HDL Coder) and Use Bus Signals to Improve Readability of Model and Generate HDL Code (HDL Coder).
This block has one default HDL architecture.
ConstrainedOutputPipeline | Number of registers to place at
the outputs by moving existing delays within your design. Distributed
pipelining does not redistribute these registers. The default is
|
InputPipeline | Number of input pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
OutputPipeline | Number of output pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Actual data type or capability support depends on block implementation.
Version History
Introduced before R2006a
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)