Bus Creation Using Bus Creator Blocks

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. For details, see Simplify Subsystem Bus Interfaces.

Bus Signal Naming

The Bus Creator block assigns a name to each signal on the bus that it creates. You can then refer to signals by name when you search for their sources (see Browse Signals in a Bus) or select signals for connection to other blocks.

Specify one of the following signal naming options:

  • 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 the port index number to all input signal names.

  • Do not use a less than character (<) to start a signal name.

  • The Bus Creator block generates names for bus signals whose corresponding inputs do not have names. The names are in the form signaln, where n is the number of the port the input signal connects to.

  • Each input signal must have a specific name.

  • If the bus output data type is a bus object, bus signal names use the corresponding bus object element names.

You can change the name of any signal by editing the name on the block diagram or in the Signal Properties dialog box. If you change the signal name while the Bus Creator Block Parameters dialog box is open,you can see the updated name in the dialog box by clicking Refresh.

Browse Signals in a Bus

The Signals in the bus list on a Bus Creator Block Parameters dialog box displays a list of the signals entering the block. You can view all signals entering the block, including the signals entering via buses. An arrow next to a signal indicates that the signal is itself a bus. To display the contents of that bus, click the arrow.

When you modify the Number of inputs parameter, click Refresh to update the list of signals. After editing the name of an input signal, update the list by licking Refresh.

To find the source of any signal entering the block, select the signal in the Signals in the bus list and click the Find button. Simulink® opens the subsystem containing the signal source, if necessary, and highlights the icon of the source.

Rearrange Signals in a Bus

To rearrange the signals in the bus, use buttons such as Up or Down.

You can select multiple contiguous signals in the Signals in the bus list to reorder or remove. 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 making your edits, click Apply.

Note

If you change elements or the order of elements in the Bus Creator block and the incoming bus is a nonvirtual bus, Simulink reports inconsistency errors when you compile the model.

Bus Object as the Output Data Type

You can use a bus object as the bus output data type for a Bus Creator block. Using a bus object can provide strong data typing with an explicit signal interface. Model referencing requires using bus objects for bus signals that cross model reference boundaries. For more information, see When to Use Bus Objects.

To create a nonvirtual bus using a Bus Creator block, use these settings.

  • For the Output data type parameter, use a bus object.

  • Select Output as nonvirtual bus.

See Also

Blocks

Classes

Related Topics