Simulink.Bus
Specify properties of buses
Description
A Simulink.Bus
object, when used with Simulink.BusElement
objects, specifies and validates the properties of a bus and
its elements. When you simulate or update a model, the software checks whether buses connected
to blocks match the Simulink.Bus
objects that the blocks
specify.
A bus object specifies only the architectural properties of a bus. For example, a bus object can specify element names, hierarchy, order, and data types. A bus object is analogous to a struct in C code because it defines the members of the bus but does not create the bus. A bus object is also similar to a cable connector. The connector defines all the pins and their configuration and controls what types of wires can be connected to it. Similarly, a bus object defines the configuration and properties of the signals that the associated bus must have.
Simulink.Bus
objects contain Simulink.BusElement
objects.
Each bus element object specifies the properties of a signal in a bus, such as its name, data
type, and dimension. The order of the bus element objects in the bus object defines the order
of the signals in the bus.
A bus object can specify properties that were not defined by constituent signals, but were left to be inherited.
To create and modify bus objects in the base workspace or a data dictionary, you can use the
Type Editor, Model Explorer, or
MATLAB® commands. You cannot store Simulink.Bus
objects in model
workspaces.
To use Simulink.Bus
objects in a model, see Specify Bus Properties with Bus Objects.
Creation
You can create a Simulink.Bus
object in multiple ways.
To interactively create a
Simulink.Bus
object, use the Type Editor or Model Explorer.To programmatically create a
Simulink.Bus
object with default properties, use theSimulink.Bus
function described below.To programmatically create
Simulink.Bus
objects from blocks in a model, MATLAB data, and external C code, see Programmatically Create Simulink Bus Objects.
Syntax
Description
returns a
name
= Simulink.BusSimulink.Bus
object with default property values. The name of the
object is the name of the MATLAB variable to which you assign the object.
Properties
Object Functions
getNumLeafBusElements | Number of leaf elements in Simulink.Bus object |
getLeafBusElements | Leaf elements in Simulink.Bus object |
Examples
Version History
Introduced before R2006aSee Also
Functions
Simulink.Bus.cellToObject
|Simulink.Bus.createObject
|Simulink.Bus.createMATLABStruct
|Simulink.Bus.objectToCell
|Simulink.Bus.save