Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Bus Selector

Select signals from incoming bus

Library

Signal Routing

Description

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. For information about buses, see:

When the block outputs separate elements, it outputs each element from a separate port from top to bottom of the block. See How to Rotate a Block for a description of the port order for various block orientations.

    Note   Simulink® software hides the name of a Bus Selector block when you copy it from the Simulink library to a model.

By default, Simulink implicitly converts a non-bus signal to a bus signal to support connecting the signal to a Bus Assignment or Bus Selector block. To prevent Simulink from performing that conversion, in the Model Configuration Parameters > Diagnostics > Connectivity pane, set the Non-bus signals treated as bus signals diagnostic to warning or error.

For information about using this block in a library block, see Buses and Libraries.

Reorder or Remove Signals

To reorder the selected signals that the Bus Selector block includes in the bus signal that it produces, click Up or Down.

You can select multiple contiguous signals in the Signals in the bus list to remove or reorder.

You cannot rearrange leaf signals within a bus. For example, you can move bus signal Bus1 up or down in the list, but you cannot reorder any of the bus elements of Bus1.

After you click a button, click Apply.

Array of Buses Support

The following limitations apply to working with arrays of buses, when using the Bus Selector block. For details about defining and using an array of buses, see Combine Buses into an Array of Buses.

  • You cannot connect an array of buses signal to a Bus Selector block. To work with an array of buses signal, first use a Selector block to select the index for the bus element that you want to use with the Bus Selector block. Then use that selected bus element with the Bus Selector block.

  • You cannot assign into a sub-bus that is an array of buses.

Data Type Support

A Bus Selector block accepts and outputs real or complex values of any data type supported by Simulink software, including fixed-point and enumerated data types.

For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink.

Parameters and Dialog Box

The Bus Selector dialog box appears as follows:

Signals in the bus

Shows the signals in the input bus.

Settings

To refresh the display to reflect modifications to the bus connected to the block, click Refresh.

Tips

  • Use Select>> to select signals to output.

  • To find the source of any signal entering the block, select the signal in the list and click Find. The Simulink software opens the subsystem containing the signal source, and highlights the source's icon.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Enable regular expression

Enable the use of MATLAB® regular expressions for filtering signal names. For example, entering t$ in the Filter by name edit box displays all signals whose names end with a lowercase t (and their immediate parents). For details, see Regular Expressions.

Settings

Default: On

On

Allow use of MATLAB regular expressions for filtering signal names.

Off

Disable use of MATLAB regular expressions for filtering signal names. Filtering treats the text you enter in the Filter by name edit box as a literal string.

Dependencies

Selecting the Options button on the right-hand side of the Filter by name edit box ( ) enables this parameter.

Show filtered results as a flat list

Uses a flat list format to display the list of filtered signals, based on the search text in the Filter by name edit box. The flat list format uses dot notation to reflect the hierarchy of bus signals. The following is an example of a flat list format for a filtered set of nested bus signals.

Settings

Default: Off

On

Display the filtered list of signals using a flat list format, indicating bus hierarchies with dot notation instead of using a tree format.

Off

Display filtered bus hierarchies using a tree format.

Dependencies

Selecting the Options button on the right-hand side of the Filter by name edit box ( ) enables this parameter.

Selected signals

Shows the signals to be output.

Settings

Default: signal1,signal2

You can change the list by using the Up, Down, and Remove buttons.

Tips

  • Port connectivity is maintained when the signal order is changed.

  • If an output signal listed in the Selected signals list box is not an input to the Bus Selector block, the signal name is preceded by three question marks (???).

Command-Line Information

See Block-Specific Parameters for the command-line information.

Output as bus

Output the selected elements as a bus.

Settings

Default: Off

On

Output the selected elements as a bus.

Off

Output the selected elements as standalone signals, each from an output port that is labeled with the corresponding element's name.

Tips

  • The output bus is virtual. To produce nonvirtual bus output, insert a Signal Conversion block after the Bus Selector block. Set the Signal Conversion block Output parameter to Nonvirtual bus and Data type parameter to use a Simulink.Bus bus object. For an example, see the Signal Conversion documentation.

  • If the Selected signals list box includes only one signal and you enable Output as bus, then:

    • If the selected signal is a non-bus signal, it is treated as a non-bus signal (it is not wrapped in a bus).

    • If the selected signal is a bus signal, then the output is that bus signal.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Examples

For an example of how the Bus Selector block works, see the sldemo_fuelsys model. The Bus Selector block appears in the following subsystems:

  • fuel_rate_control/airflow_calc

  • fuel_rate_control/validate_sample_time

Characteristics

Multidimensionalized

Yes

Virtual

Yes, if the input bus is virtual

For more information, see Virtual Blocks in the Simulink documentation.

Was this topic helpful?