Assign Interfaces to Ports
A port interface describes the data that can be passed between ports in a System Composer™ architecture model. Data elements within the interface describe characteristics of the data transmitted across the interface. Data elements can describe the composition of a data interface, messages transmitted, or data structures shared between components. For interfaces terminology, see Define Port Interfaces Between Components.
This topic will show you how to:
Use the Property Inspector to assign data interfaces to one port at a time or the Interface Editor to assign data interfaces to multiple ports.
Manage owned interfaces that are local to a port and not shared in a data dictionary.
Assign interfaces to multiple ports at the same time.
Connect components through ports and specify the source element or the destination element for the connection.
Incompatible data interfaces on either end of a connection can be reconciled with an Adapter block using the Interface Adapter. To manage interfaces shared between models in data dictionaries, see Manage Interfaces with Data Dictionaries. For information on physical interfaces, see Specify Physical Interfaces on Ports.
Mobile Robot Architecture Model with Interfaces
This example shows a mobile robot hardware architecture with interfaces defined.
Associate Ports with Interfaces in Property Inspector
To assign data interfaces or value types to one port at a time, use the Property
Inspector. To open the Property Inspector, navigate to Modeling > Design > Property Inspector. To show the
SensorData port properties, select the port in
the model. Expand Interface, and from the Name
sensordata to associate the
interface with the
Define Owned Interfaces Local to Ports
You can select a value type or data interface from the model data dictionary in the Property Inspector, or you can create an owned interface.
An owned interface is an interface that is local to a specific port and not shared in a data dictionary or the model dictionary.
Create an owned interface to represent a value type or data interface that is local to a port.
Owned interfaces and value types do not have their own names because they are local to a port and not shared. The name of the owned interface is derived from the port name.
Manage Owned Interfaces Using Property Inspector
You can edit the data for the owned interface in the Property Inspector. Select the
Docking architecture port. In the Property Inspector, under
Interface, from the Name list, select
By default, the owned interface
Docking becomes an owned value
type. Edit interface attributes directly in the Property Inspector, or select
Open in Interface Editor to edit the owned value type
To convert the owned value type into an owned data interface, click to add a data element.
Manage Owned Interfaces Using Interface Editor
Click to add data elements to the owned data interface.
To convert the owned data interface to an owned value type, change the
Feedback to a valid MATLAB® data type, such as
Make Owned Interfaces into Shared Interfaces
To convert an owned interface into a shared interface, right-click the port with the
owned interface and select
Convert to shared interface.
Alternatively, use the
Select Multiple Ports and Assign Data Interface
Multiple ports, whether they are connected or not, can use the same data interface
definition. When you assign a data interface to a port, the interface is automatically
propagated to connected ports, provided they do not already have assignments. To simplify
batch assignments, select multiple ports, right-click the data interface, and select
Assign to Selected Port(s).
Highlight the ports that use a data interface definition by clicking the interface name in the Interface Editor.
Specify Source Element or Destination Element for Ports
For connections between the root architecture and a component within the architecture model, you can add a source element or destination element to the ports.
Create a component called
Motorand connect it to the root architecture with ports named
Define the data interface
Wheelwith the data elements
Wheeldata interface to the ports on the connection.
MotionDataport name on the component. A dot and a list of data elements appear. From the list, select the source element
MaxSpeeddestination element to the