Main Content

Define Interfaces

An interface defines the information that flows through a port. The same interface can be assigned to multiple ports. An interface can include elements that describe the properties of an interface signal. Interfaces represent the information that is shared through a connector and enters or exits a component through a port. Use the Interface Editor to create and manage interfaces and interface elements and store them in an interface data dictionary for reuse between models.

An interface element is a piece of data that is transmitted across an interface, such as a communication message, a calculated or measured parameter, or other decomposition of that interface. Examples of interface elements include:

  • Pins or wires in a connector or harness.

  • Messages transmitted across a bus.

  • Data structures shared between components.

A system engineering solution includes a formal definition of the interfaces between components. A connection shows that two components have an output-to-input relationship, and an interface defines the type, dimensions, units, and structure of the data.

To show the Interface Editor, in the Design section, on the Modeling tab, select Interface Editor. The Interface Editor will open along the bottom pane.

exMobileRobot architecture model with the interface editor indicated in red


The System Composer™ Interface Editor is a web-based widget and might appear blank when you first launch it. If this occurs, save the model and relaunch MATLAB® with the command line option -cefdisablegpu.

Create Interface

To add a new interface definition, click the icon. Name the interface.

Interface editor showing one defined interface named 'sensor data'.

To add an element to the interface, click the add element icon. Interface and element names must be valid variable names.

Interface elements named 'coordinates' and 'motor speed' shown below an interface named 'sensor data'.

You can delete interfaces and elements in the Interface Editor using the delete button.

You can view and edit the properties of an element in the Property Inspector. Right-click the interface element and select Inspect Properties. For interfaces, use the Property Inspector to apply stereotypes.

Properties for the interface element named 'motor speed' in the property inspector showing. Properties include Type as double, Dimensions as 1, Units as blank, Complexity as real, Minimum, which is empty, Maximum, which is empty, and Description, which is blank.

For a comparative view, you can edit interface element properties from the Interface Editor columns.

Units being edited for the property under the motor speed interface element.

Nested Interfaces

A nested interface contains another interface. Create a nested interface by assigning an interface as the type of an interface element. For information about the corresponding bus objects, see Nest Bus Objects Using the Bus Editor.

For example, let coordinates be an interface that consists of x, y, and z coordinates. GPSdata includes location and a timestamp. If the location element is in the same format as the coordinates interface, you can set its type to coordinates. Right-click location and select Set 'Type' > coordinates. The available interface options include all interfaces in the model, except the parent of the element.

Interface editor with three interfaces named 'sensor data', 'coordinates' and 'GPS data'. Below each are interface elements with properties defined. The 'location' interface element under the interface named 'GPS data' has been right-clicked. The user is selecting the option 'Set type' to choose the interface named 'coordinates'.

The nested interface displays the inherited interface elements.

The coordinates interface is nested into the location interface element under GPS data. All coordinates interface elements show below location.

Show and Hide Columns in the Interface Editor

To change the number of columns that display in the Interface Editor, select the show hide columns icon. Select or deselect the desired columns to show or hide them.

The Interface Editor view with the drop down next to the show hide columns icon is selected. The columns Type, Dimensions, and Units are selected.

See Also

| | | | | | |

Related Topics