Main Content

Assign Interfaces to Ports

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.

Associate a Port with an Interface in the Property Inspector

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.

Demonstrates the process in the property inspector for selecting the 'Name' under 'Interface'. The interface name selected, using the drop down menu, is called 'sensor data'.

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.

Select Multiple Ports and Assign an Interface

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.

The interface named 'sensor data' is selected in the interface editor. The ports that are associated with it are highlighted in purple in the model.

Specify a Source Element or Destination Element for Ports on a Connection

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.

The interface element rotation speed is the source element for the motion data port on the motor component.

Reconcile Different Interfaces on Connected Ports using an Adapter block

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.

View of using the left toolstrip to click and drag an adapter block into the model. The adapter block is inserted between the 'Sensor' component and the 'Motor' component along the connection between two different ports that are called 'Motor Data' and 'Motion Data'.

Change the number of input ports on an Adapter block the same way you add and remove component ports. For more information, see Ports.

See Also



Related Topics