| Contents | Index |
Signal Routing
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 ports that you specify. Connect to the resulting input ports those signals that you want to group. See Using Composite Signals for information about buses.
The signals in the bus are ordered from the top input port to the bottom input port. See How to Rotate a Block in for a description of the port order for various block orientations.
You can connect any type of signal to the inputs, including other bus signals. To ungroup the signals, connect the output port of the block to a Bus Selector block port.
Note Simulink hides the name of a Bus Creator block when you copy it from the Simulink library to a model. |
You can use an array of buses as an input signal to a Bus Creator block. For details about defining and using an array of buses, see Combining Buses into an Array of Buses.
The Bus Creator block assigns a name to each signal on the bus that it creates. This allows you to refer to signals by name when you searching for their sources (see Browsing Bus Signals) or selecting signals for connection to other blocks.
The block offers two bus signal naming options. You can specify that:
Each signal on the bus inherits the name of the signal connected to the bus (the default).
Inputs to a Bus Creator block must have unique names. If there are duplicate names, the Bus Creator block appends (signal#) to all input signal names, where # is the input port index.
Each input signal must have a specific name.
To specify that bus signals inherit their names from input ports, select Inherit bus signal names from input ports from the list box on the Block Parameters dialog box. The names of the inherited bus signals appear in the Signals in the bus list box. For example, suppose that you have the following model:

In the dialog box for LIMITBUSCreator, the signals upper_saturation_limit and lower_saturation_limit appear in the Signals in the bus list box:

The Bus Creator block generates names for bus signals whose corresponding inputs do not have names. The names are of the form signaln, where n is the number of the port to which the input signal is connected.
You can change the name of any signal by editing its name on the block diagram or in the Signal Properties dialog box. If you change the signal name using either approach while the Bus Creator block dialog box is open, you need to update the name in the dialog box. To do so, close and reopen the dialog box or click the Refresh button next to the Signals in the bus list.
To specify that the bus inputs must have specific names, select Require input signal names to match signals below from the list box in the block parameter dialog box. The block parameter dialog box displays the names of the signals currently connected to its inputs, or a generated name (for example, signal2) for an anonymous input. Then you can use the parameter dialog box to change the required names of the block inputs.
To change the required signal name, select the signal in the Signals in the bus list. The name of the selected signal appears in the Rename selected signal field. Edit the name in the field and click Apply or OK.
The Signals in the bus list on a Bus Creator Block Parameters dialog box displays a list of the signals entering the block. A plus sign (+) next to a signal indicates that the signal is itself a bus. To display the contents of the bus, click the plus sign. If the expanded input includes bus signals, plus signs appear next to the names of those bus signals. You can expand them as well. In this way, you can view all signals entering the block, including those entering via buses.
To find the source of any signal entering the block, select the signal in the Signals in the bus list and click the adjacent Find button. Simulink opens the subsystem containing the signal source, if necessary, and highlights the source's icon.
The Bus Creator block accepts and outputs real or complex values of any data type supported by Simulink, including fixed-point and enumerated data types, as well as bus objects.
For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Simulink documentation.

Assign input signal names to the corresponding bus signals.
Default: Inherit bus signal names from input ports
Assign input signal names to the corresponding bus signals.
Inputs must have the names listed in the Signals in bus list.
Selecting Require input signal names to match signals below enables Rename selected signal.
See Block-Specific Parameters for the command-line information.
Specify the number of input ports on this block.
Default: 2
To bundle a group of signals, enter the number of signals in the group.
See Block-Specific Parameters for the command-line information.
Show the signals in the output bus.
When you modify the Number of inputs parameter, click Refresh to update the list of signals.
A plus sign (+) next to a signal name indicates that the signal is itself a bus. Click the plus sign to display the subsidiary bus signals.
Click the Refresh button to update the list after editing the name of an input signal.
Click the Find button to highlight the source of the currently selected signal.
See Block-Specific Parameters for the command-line information.
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.
Default: On
Allow use of MATLAB regular expressions for filtering signal names.
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.
Selecting the Options button on the right-hand
side of the Filter by name edit box (
) enables this parameter.
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.

Default: Off
Display the filtered list of signals using a flat list format, indicating bus hierarchies with dot notation instead of using a tree format.
Display filtered bus hierarchies using a tree format.
Selecting the Options button on the right-hand
side of the Filter by name edit box (
) enables this parameter.
List the name of the signal currently selected in the Signals in the bus list when you select the Require input signal names to match signals below option.
Default: ''
Edit this field to change the name of the currently selected signal. See Signal Names for guidelines for signal names.
Selecting Require input signal names to match signals below for Parameters and signal1 or signal2 for Signals in the bus enables this parameter.
See Block-Specific Parameters for the command-line information.
Specify the output data type of the external input.
Default: Inherit: auto
A rule that inherits a data type
Data type is a bus object.
The name of a data type object, for example Simulink.NumericType
Do not specify a bus object as the expression.
See Block-Specific Parameters for the command-line information.
Display the Data Type Assistant.
The Data Type Assistant helps you set the Output data type parameter.
See Specifying Block Output Data Types for more information.
See Block-Specific Parameters for the command-line information.
Select the category of data to specify.
Default: Inherit
Inheritance rule for data types. Selecting Inherit enables a second menu/text box to the right.
Bus object. Selecting Bus enables a Bus object parameter to the right, where you enter the name of a bus object that you want to use to define the structure of the bus. If you need to create or change a bus object, click Edit to the right of the Bus object field to open the Simulink Bus Editor. For details about the Bus Editor, see Using the Bus Editor.
Expressions that evaluate to data types. Selecting Expression enables a second menu/text box to the right, where you can enter the expression.
Do not specify a bus object as the expression.
At the beginning of a simulation or when you update the model diagram, Simulink checks whether the signals connected to this Bus Creator block have the specified structure. If not, Simulink displays an error message.
Clicking the Show data type assistant button enables this parameter.
See Block-Specific Parameters for the command-line information.
See Using the Data Type Assistant in the Simulink User's Guide.
Output a nonvirtual bus.
Default: Off
Select this option if you want code generated from this model to use a C structure to define the structure of the bus signal output by this 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 that would result in a nonvirtual bus that violates this requirement generates an error. Therefore, if you select this option all signals entering the Bus Creator block must have the same sample time. You can use a Rate Transition block to change the sample time of an individual signal, or of all signals in a bus, to allow the signal or bus to be included in a nonvirtual bus.
The following Data type values enable this parameter:
Bus: <object name>
<data type expression> that specifies a bus object
See Block-Specific Parameters for the command-line information.
For an example of how the Bus Creator block works, see the sldemo_househeat model.
Multidimensionalized | Yes |
Virtual | Yes, if the output bus is virtual For more information, see Virtual Blocks in the Simulink documentation. |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |