A port interface describes the data that can be passed between ports. Interface elements within the interface describe characteristics of the data transmitted across the interface. Interface elements can describe the composition of an interface, messages transmitted, or data structures shared between components.
Use the Property Inspector to assign interfaces to one port at a time or the Interface Editor to assign interfaces to multiple ports.
You can connect components through ports and specify the source element or the destination element for the connection.
Incompatible interfaces on either end of a connection can be reconciled with an Adapter block using the Interface Adapter.
To open the Property Inspector, locate it in the toolstrip in the
Design section drop down. To show the SensorData
port properties, highlight the port in the model. Expand Interface, and
select the sensordata
interface in the Name
drop-down menu.
You can select an interface in the model data dictionary (see Define Interfaces), or create an anonymous interface — an interface of unstructured data whose properties are valid for that port only. An anonymous interface does not have a structure, but does have prescribed properties such as Type and Dimensions. You can edit the properties of the anonymous interface in the Property Inspector.
Multiple ports, whether they are connected or not, can use the same interface
definition. When you assign an interface to a port, it is automatically propagated to the
connected ports, provided they do not already have assignments. To simplify batch
assignments, select multiple ports, right-click the interface, and select
Assign to Selected Port(s)
.
Highlight the ports that use an interface definition by clicking the interface name in the Interface Editor.
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 Motor
and connect it to the root
architecture with ports named MotionData
and
SpeedData
. Define the interface Wheel
with the
interface elements RotationSpeed
and MaxSpeed
. Assign
the Wheel
interface to the ports on the connection. Select the
MotionData
port name on the component and a dot and a list of signal
interface elements will appear. Select the source element RotationSpeed
from the list. Assign the MaxSpeed
destination element to the
SpeedData
port.
A source port and the destination port to which it connects may be defined by different interfaces. Such a connection can represent an intermediate point in design, where components from different sources come together. To connect components with different interfaces, use an Adapter block from the component palette and the Interface Adapter.
Change the number of input ports on an Adapter block the same way you add and remove component ports. For more information, see Ports.