Bus Editor
Create, modify, and manage bus objects
Description
The Bus Editor lets you interactively create, modify, and manage
Simulink.Bus
and Simulink.ConnectionBus
objects and the Simulink.BusElement
or Simulink.ConnectionElement
objects that they contain.
The Sources pane provides available sources, which are the MATLAB® base workspace and open data dictionaries. The objects that you create are stored in the selected source. In the toolstrip, you can create or open a data dictionary. You can also import objects defined by a MAT file, function, or script into the base workspace.
An interactive table displays information about the objects, such as hierarchy and properties. You can select which columns appear in the table by using the Columns list in the toolstrip. Use the table to:
Filter contents — Enter a universal filter or a column-specific filter.
Change values — Double-click a value in the table and enter a new value. Edit the properties of a bus object and its elements at the top level, not where the bus object is specified as a data type.
Reorder elements — Drag the elements to a new position or use the Move Up and Move Down buttons in the toolstrip.
Cut, copy, and paste elements — Use keyboard shortcuts or the corresponding buttons in the toolstrip.
Delete elements — Press the Delete key or click the Delete button in the toolstrip. When you delete a bus object, you also delete the element objects it contains. Update any blocks that specify the deleted object. To find where a bus object is used in a model, see Finding Blocks That Use a Specific Variable.
In the table, you can edit multiple selected objects of the same type at the same time.
The Property Inspector pane lets you focus on one object at a time and edit its properties. When you enter a value that is not supported, a diagnostic message appears in this pane.
Note
The Bus Editor does not support undo or redo actions. Changes that create, reorder, or delete objects take effect immediately in the base workspace.
The Bus Editor can export object definitions to a MAT file
(.mat
) or function (.m
). It can also create a
MATLAB structure or Simulink.Parameter
object from a
Simulink.Bus
object. You can find these actions in the
Share section of the toolstrip.
Open the Bus Editor
Simulink® Toolstrip: On the Modeling tab, in the Design gallery, click Bus Editor.
MATLAB Command Window: Enter
buseditor
.Model Explorer: In a bus object dialog box, click Launch Bus Editor.
Examples
Tips
A bus object cannot directly or indirectly reference itself. If you define a circular structure, the Bus Editor keeps the original data type of the element that would have completed the circle.
Display only the columns that are relevant to you in the Bus Editor. For example, if you do not use
Simulink.ConnectionBus
objects, in the Bus Editor toolstrip, click Columns and clear Type.When you have a model that creates a bus with a Bus Creator block, you can use the
Simulink.Bus.createObject
function to create the corresponding objects instead of creating eachSimulink.Bus
andSimulink.BusElement
object individually.