In Bus Element, Bus Element In

Select signal that connects to input port

  • Library:
  • Simulink / Ports & Subsystems

    Simulink / Sources

    HDL Coder / Ports & Subsystems

    HDL Coder / Sources

  • In Bus Element block

Description

The In Bus Element block, also known as the Bus Element In block, combines the functionality of an Inport block and a Bus Selector block. This block is of the Inport block type and all In Bus Element blocks that use the same port share a Block Parameters dialog box.

You can use an In Bus Element block to select a virtual bus element, virtual bus, or nonbus signal associated with the port. To select multiple signals from a bus, use multiple In Bus Element blocks.

Create Port and Related Blocks

When you insert an In Bus Element block, the block label populates with default values. The label consists of two interactive text fields: the port name and the bus element. To change the name of the port associated with the block, edit the first text field in the label by clicking in it.

To create related In Bus Element blocks, in the Block Parameters dialog box, you can select the Add blocks for selected signals button.

If multiple blocks are associated with the same port and you change the name of the port, all blocks that share the port update to reflect the new port name.

You can create additional ports by holding Ctrl while you drag an existing In Bus Element block to a new location. Upon releasing the mouse, you have the option to create a port or use the existing port associated with the block being copied.

Examine Port Input

You can view the signals associated with a port in the Block Parameters dialog box for any of the related In Bus Element blocks.

Black element names are already associated with an In Bus Element block. Grey element names are available, but are not being used. Red element names are not available in the input bus, despite being specified by an In Bus Element block.

You can create In Bus Element blocks for each selected signal by clicking the Add blocks for selected signals button .

To remove blocks associated with selected elements, such as elements which are unavailable in the input bus, click the Remove blocks of selected signals button .

Select a Signal

To change the bus element associated with the block, edit the second text field in the label by clicking in it.

If a bus is connected to the port, you can select an element of the bus from the list that appears. To see all elements of the bus along with the previously specified signal, clear the text. The list of elements is filtered to include only the elements that contain the existing text.

Each dot in the part of the label that describes the bus element indicates a new level of bus hierarchy. To reduce the size of the label, you can display only the signal name by selecting the block, pausing over the ellipsis, and selecting Compact Notation from the action bar. To show the signal hierarchy again, select Expanded Notation from the action bar.

You can pass through the entire input connected to the port, including nonbus signals, by deleting the text from the second text field. Referenced models do not support passing through an entire bus.

Load Input Data

You can use an In Bus Element block to load external input data for a bus. An In Bus Element block can load data for an element of a bus or for an entire bus. When you use an In Bus Element block to load data for an entire bus, you must specify the data type for the block using a Simulink.Bus object. For more information about loading input data for bus elements, see Load Input Data for a Bus Using In Bus Element Blocks.

You can load simulation input data for a group of root-level In Bus Element blocks by using a structure of timeseries, timetable, or SimulationDatastore objects. In Bus Element blocks interpolate loaded data for all data types except string, enumerated, and fixed point.

Ports

Output

expand all

Selected input bus or bus element that is associated with an external subsystem or model port.

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | string | Boolean | fixed point | enumerated | bus

Parameters

expand all

Specify a port name that is not already in use by another block or port. The name appears on the parent Subsystem or Model block. The name also appears next to the block. Multiple blocks can access the same port.

Programmatic Use

Block Parameter: PortName
Type: character vector
Values: 'InBus' | '<port name>'
Default: 'InBus'

Specify the order in which the port that corresponds to the block appears on the parent Subsystem or Model block.

  • If you add a block that creates another port, the port number is the next available number.

  • Deleting all blocks associated with a port deletes the port. Other ports are renumbered so that they are sequential and do not skip any numbers.

  • Specifying a port number that exceeds the number of ports creates a port for that number and for any skipped sequential numbers.

Programmatic Use

Block Parameter: Port
Type: character vector
Values: real integer
Default: '1'

Specify the block background color. This specification sets the color of blocks associated with selected bus elements, or of all blocks associated with the port if you do not select any bus elements.

Programmatic Use

Block Parameter: BackgroundColor
Type: character vector
Values: 'black' | 'white | 'red' | 'green' | 'blue' | 'cyan' | 'magenta' | 'yellow' | 'gray' | 'lightBlue' | 'orange' | 'darkGreen' | '[r,g,b]' where r, g, and b, are the red, green, blue values of the color in the range 0.0 to 1.0
Default: 'black'

Specify a search term to use for filtering a long list of bus elements. Do not enclose the search term in quotation marks. The filter does a partial string search and supports regular expressions. To use a regular expression character as a literal, include an escape character (\). For example, to use a question mark, type sig\?1.

Signal Attributes

To specify signal attributes, click the pencil button or the specified attributes next to a signal name.

Specify the data type. The type can be inherited, specified directly, or expressed as a data type object such as Simulink.NumericType.

Examples of built-in data types include double and uint8. For more information, see Data Types Supported by Simulink.

If you specify a data type expression, specify an expression that evaluates to a Bus object.

Specify the dimensions of a signal.

-1

The signal can have any dimensions.

N

The signal must be a vector of size N.

[R C]

The signal must be a matrix having R rows and C columns.

Programmatic Use

Block Parameter: PortDimensions
Type: character vector
Values: '-1' | integer | [integer, integer]
Default: '-1'

Specify the type of signals allowed. To allow variable-size and fixed-size signals, select Inherit. To allow only variable-size signals, select Variable. To not allow variable-size signals, select Fixed.

Dependencies

When the signal is variable-sized, the Dimensions parameter specifies the maximum dimensions of the signal.

Command-Line Information

Parameter: VarSizeSig
Type: character vector
Value: 'Inherit '| 'No' | 'Yes'
Default: 'Inherit'

Specify the physical unit of the signal. For a list of supported units, see Allowed Unit Systems.

Programmatic Use

Block Parameter: Unit
Type: character vector
Values: 'inherit' | '<Enter unit>'
Default: 'inherit'

Specify the discrete interval between sample time hits or specify another appropriate sample time such as continuous or inherited.

By default, the signal inherits its sample time. To set a different sample time, enter a valid sample time based on the table in Types of Sample Time.

Programmatic Use

Block Parameter: SampleTime
Type: character vector
Values: scalar
Default: '-1'

Specify the numeric type of the signal. To choose the numeric type of the signal, select auto. Otherwise, choose a real or complex signal type.

Programmatic Use

Block Parameter: SignalType
Type: character vector
Values: 'auto' | 'real' | 'complex'
Default: 'auto'

Lower value of the range that Simulink checks.

This number must be a finite real double scalar value.

Simulink software uses this value to perform:

  • Simulation range checking (see Specify Signal Ranges).

  • Automatic scaling of fixed-point data types.

  • Optimization of the code that you generate from the model. This optimization can remove algorithmic code and affect the results of some simulation modes such as SIL or external mode. For more information, see Optimize using the specified minimum and maximum values (Embedded Coder).

Programmatic Use

Block Parameter: OutMin
Type: character vector
Values: '[ ]'| scalar
Default: '[ ]'

Upper value of the range that Simulink checks.

This number must be a finite real double scalar value.

Simulink software uses this value to perform:

  • Simulation range checking (see Specify Signal Ranges).

  • Automatic scaling of fixed-point data types.

  • Optimization of the code that you generate from the model. This optimization can remove algorithmic code and affect the results of some simulation modes such as SIL or external mode. For more information, see Optimize using the specified minimum and maximum values (Embedded Coder).

Programmatic Use

Block Parameter: OutMax
Type: character vector
Values: '[ ]'| scalar
Default: '[ ]'

Block Characteristics

Data Types

Boolean | bus | double | enumerated | fixed point | half | integer | single | string

Direct Feedthrough

no

Multidimensional Signals

yes

Variable-Size Signals

yes

Zero-Crossing Detection

no

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Introduced in R2017a