Documentation

Bus Creator

Create bus signal from input signals

  • Library:
  • Simulink / Commonly Used Blocks

    Simulink / Signal Routing

Description

The Bus Creator block combines a set of signals into a bus. To bundle a group of signals with a Bus Creator block, set the block parameter Number of inputs to the number of signals in the group. The block displays the number of inport ports that you specify. Connect to the resulting input ports the signals that you want to group.

You can connect any type of signal to the inputs, including other bus signals. To access individual signals in a bus signal, connect the output port of the block to a Bus Selector block port.

The signals in the bus are ordered from the top input port to the bottom input port. See Port Location After Rotating or Flipping for a description of the port order for various block orientations. To rearrange the signals in the output bus signal, use buttons such as Up or Down buttons.

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

Tip

For models that include bus signals composed of many bus elements that feed subsystems, 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. These 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.

Ports

Input

expand all

Input signals can have real or complex values of any data type supported by Simulink, including bus objects, arrays of buses, fixed-point, and enumerated data types. For details about data types, see Simulink, Data Types Supported by Simulink.

Output

expand all

Bus that combines the input signals.

Parameters

expand all

Number of inputs, not fewer than two. Increasing the number of connected ports adds empty ports below the connected ports. Before you simulate the model, make sure an input signal is connected to each input port.

Tip

As you draw a new signal line close to input side of a virtual Bus Creator block, if all input ports are already connected, the :

  • Adds another input port to the Bus Creator block

  • Updates the Number of inputs parameter

  • Add to the list of bus signals a signal name for the new signal

Programmatic Use

Block Parameter:Inputs
Type:character vector
Values:integer greater than or equal to 2
Default:'2'

List of input signals to combine into a bus signal. An arrow next to a signal name indicates that the input signal is a bus. To display the signals in an input bus, click the arrow. For information about working with the signals in the list, see Bus Creation Using Bus Creator Blocks .

Specify a search term to filter a long list of input signals. Do not enclose the search term in quotation marks. The filter does a partial string search. To access filtering options, including using a regular expression to specify the search term, click the button on the right side of the Filter by name edit box.

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 (MATLAB).

Dependencies

To access this parameter, click the button on the right side of the Filter by name edit box.

By default, a tree list displays the filtered signals, based on the search text in the Filter by name edit box. To use a flat list format that uses dot notation to reflect the hierarchy of bus signals, select this parameter.

Dependencies

To access this parameter, click the button on the right-hand side of the Filter by name edit box

Data type of the output bus signal.

Determine whether you want the Bus Creator block to output a virtual or nonvirtual bus.

  • For a virtual bus, use the Output data type parameter default (Inherit: auto) or set the parameter to specify a bus object using Bus: <object name>.

  • For a nonvirtual bus, set the Output data type parameter to specify a bus object using Bus: <object name> and click Output as nonvirtual bus.

If you select 'Bus: <object name>', specify a bus object in the edit box. The bus object must be in the base workspace when you perform an update diagram or simulate the model. To define a bus object using the Bus Editor, click Show data type assistant and then click Edit. For details, see Create Bus Objects with the Bus Editor.

If you select '<data type expression>', specify an expression that evaluates to a data type. Do not specify a bus object as the expression.

Programmatic Use

Block Parameter:OutDataTypeStr
Type:character vector
Values:{'Inherit: auto'} | 'double' | 'single' | 'int8' | 'uint8' | 'int16' | 'uint16' | 'int32' | 'uint32' | 'boolean' | 'fixdt(1,16,0)' | 'fixdt(1,16,2^0,0)' | 'Enum: <class name>' | 'Bus: <object name>'
Default:'inherit: auto'

To check that the input signal names match the signal names in the Bus Creator Block Parameters dialog box, enable this parameter (the default setting).

Tip

The Require input signal names to match signals above parameter might be removed in a future release. To enforce strong data typing, consider using the Override bus signal names from inputs parameter. If you select Override bus signal names from inputs, the Require input signal names to match signals above setting is ignored.

Programmatic Use

Block Parameter:OutDataTypeStr
Type:character vector
Values:'on' | 'off'
Default:'on'

Specify a name for the currently selected input signal. See Signal Names and Labels for guidelines for signal names.

Dependencies

The Require input signal names to match signals above parameter must be enabled.

By default, the Bus Creator block overrides bus signal names from inputs. To inherit bus signal names from a bus object, clear this parameter. Clearing the parameter:

  • Enforces strong data typing.

  • Avoids having to enter a signal name multiple times: in the bus object and in the model. Entering the name multiple times can accidentally create signal name mismatches.

  • Supports the array of buses requirement to have consistent signal names across array elements.

Alternatively, you can enforce strong data typing and also check that input signal names match the bus object element names.

  • Select the Override bus signal names from inputs check box.

  • Set the Element name mismatch parameter to error.

Dependencies

To display this parameter, the Output data type parameter must be set to a bus object.

Programmatic Use

Block Parameter:InheritFromInputs
Type:character vector
Values:'on' | 'off'
Default:'on'

Output a nonvirtual bus from the Bus Creator block. All signals in a nonvirtual bus must have the same sample time, even if the elements of the associated bus object specify inherited sample times. Any bus operation resulting in a nonvirtual bus that violates this requirement generates an error. To include in a nonvirtual bus a signal or bus that has a different sample time than the other input signals, use a Rate Transition block to change the sample time that signal. For details, see Specify Bus Signal Sample Times.

Enable this parameter to generate code that uses a C structure to define the structure of the bus signal output by this block.

Dependencies

The Output data type parameter must be set to a bus object.

Programmatic Use

Block Parameter:NonVirtualBus
Type:character vector
Values:'on' | 'off'
Default:'on'

Block Characteristics

Data Types

double | single | Boolean | base integer | fixed point | enumerated | bus

Multidimensional Signals

Yes

Variable-Size Signals

Yes

Extended Capabilities

HDL Code Generation
Generate Verilog and VHDL code for FPGA and ASIC designs using HDL Coder™.

Introduced before R2006a

Was this topic helpful?