Component Interface View
Display component interfaces to trace port connections and author ports
Renamed from Interface Display in R2024b
Description
The Component Interface View displays the input ports, output ports, and boundary of the current subsystem or model.
When you build large model hierarchies, the Component Interface View can help you:
Identify input and output ports.
Trace input ports to their destinations.
Trace output ports to their sources.
Author input and output ports.
Edit types assigned to ports.
The Component Interface View also supports the same interactions as the Simulink® Editor. For example, you can edit block diagrams and display information overlays such as sample time.
Open the Component Interface View
Simulink Toolstrip: On the Modeling tab, in the Design gallery, click Interface View.
Simulink Editor: Press Ctrl+Shift+V.
MATLAB® Command Window: Open a model or subsystem. Then, enter
interfaceView
.
Examples
Identify Ports and Corresponding Blocks
You can use the Component Interface View to easily identify ports of a model or subsystem, regardless of where the corresponding blocks are in the block diagram.
For example, open the model named slexAircraftExample
.
To inspect the interfaces of the model components, open the Component Interface View. On the Modeling tab, in the Design gallery, click Interface View. Alternatively, press Ctrl+Shift+V.
The Component Interface View displays the input and output ports on the component boundary. Where the Component Interface View displays the ports depends on the type of component.
Models — By default, the Component Interface View displays the input ports on the left and the output ports on the right. To move a port in the Component Interface View, select the port and use the arrow keys. To save the modified the Component Interface View port locations, save the model.
Subsystems — The Component Interface View displays each port in the same location as the subsystem block displays the port. When you move a port in the Component Interface View, you also move the port on the subsystem block.
In this example, the top level of the model has an input port named u
and an output port named alpha, rad
.
The Subsystem block named Controller
has three input ports on the left and one output port on the right. To open the subsystem, double-click the block.
Matching the Subsystem block, the Component Interface View displays three input ports on the left and one output port on the right.
To find the blocks that correspond with the input port named Stick Input
, click the corresponding port icon on the component boundary.
The Component Interface View selects the Inport block named Stick Input
and draws a line between the port and the block.
To find the blocks that correspond with the input port named q (rad/sec)
, click the corresponding port icon on the component boundary.
The Component Interface View selects the Inport block named q (rad/sec)
and draws a line between the port and the block.
Trace Port Usage
To open the project and top model named ValueTypesTirePressure
, open the example. To update the line styles and load the referenced models, compile the model. In the Simulink Toolstrip, on the Modeling tab, click Update Model or Run.
Navigate into a referenced model. For example, double-click the Model block named Sensor1
.
To inspect the interfaces of the model components, open the Component Interface View. On the Modeling tab, in the Design gallery, click Interface View. Alternatively, press Ctrl+Shift+V.
To trace a signal, bus, or message at a port, select the port. Then, click Show usage. For example, show usage for the output port named SensorTransmission
.
The Property Inspector opens. The Component Interface View traces the usage of the top-level bus, signal, or message that the port receives. In this example, the output port receives a bus.
To trace the usage of a bus element, in the Property Inspector, select the element. For example, select TirePressure
.
The Component Interface View traces the usage of TirePressure
from the output port to the input port.
The Component Interface View also traces usage through subsystem boundaries. Open the referenced model named ValueTypesTirePressureController
by double-clicking the Model block named Controller
at the top level of the model hierarchy. Then, select the input port named SensorData
and click Show usage.
To see how the subsystem named RangeChecker
uses the input from SensorData
, double-click the Subsystem block.
The Component Interface View traces the bus usage through the subsystem.
Author and Connect Ports
The Component Interface View helps you add, remove, and modify ports at a model or subsystem interface.
For this example, open a new model.
To author the model interface, open the Component Interface View. On the Modeling tab, in the Design gallery, click Interface View. Alternatively, press Ctrl+Shift+V.
To view port authoring options, click the component boundary.
While input ports are typically on the left and output ports are typically on the right, you can create the ports on any side.
To create an input port, select Input.
The Component Interface View adds a port and a block that represents
the port. Optionally, enter a new name for the port. For example, enter
In
.
To create an output port, select Output.
The Component Interface View adds a port and a block that represents
the port. Optionally, enter a new name for the port. For example, enter
Out
.
Optionally, add blocks to the block diagram. For example, add a Gain block.
To connect a port, perform one of these actions:
Drag a port on a block that represents a component port to a supported block port.
Drag a port on the component boundary to a supported block port.
Drag a block port to a supported port on the component boundary.
Drag a port on the component boundary to a supported port on the component boundary.
Drag a block port or component port to a location on the component boundary. The Component Interface View creates the supported type of component port. For example, when you drag an input port to the component boundary, the Component Interface View creates an output port.
To delete a port, select the port. Then, press Delete.
Edit Types at Interface
You can use the Component Interface View in combination with the Type Editor to create, modify, and apply types to ports at a component interface.
For example, open the ComponentBasedModeling
project. The project opens the top model in a model hierarchy. To update the line styles, in the Simulink Toolstrip, on the Modeling tab, click Update Model or Run. Updating the line styles can help you visually identify buses.
To inspect the interfaces of the model components, open the Component Interface View. On the Modeling tab, in the Design gallery, click Interface View. Alternatively, press Ctrl+Shift+V.
Suppose you want to define the interface of the Plant
subsystem with Simulink.Bus
objects.
Open the Plant
subsystem.
To begin editing port data types, select a port. For example, select the new control
port. Then, click Edit types.
The docked Type Editor opens. Expand the ComponentControllerData
dictionary, which contains Simulink.Bus
objects named Controls
, Goals
, and Sensors
.
Right-click the Controls
bus object. Then, click Apply type to selected blocks and ports.
The port now uses the Controls
bus object.
Optionally, create a bus object to represent the port named disturbance
. The Sensors
bus object can represent the port named sensor
.
To apply bus objects to the remaining ports, in the Component Interface View, select a port. Then, in the Type Editor, right-click the corresponding bus object and click Apply type to selected blocks and ports.
Related Examples
Programmatic Use
interfaceView
interfaceView
opens the Component Interface View for
the current system. For more information, see gcs
.
interfaceView(sys
)
sys
)interfaceView(
opens the Component
Interface View for the system specified by sys
)sys
. In quotes,
specify a model name or a Subsystem block path in a loaded
model.
Version History
Introduced in R2014bR2024b: Renamed from Interface Display
To reflect the new editing actions, the Interface Display is now called the Component Interface View. This view supports the same interactions as the Simulink Editor. For example, you can edit block diagrams and display information overlays such as sample time.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)