Define Port Interfaces Between Components
A systems engineering solution in System Composer™ 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.
Note
When you load existing interface data dictionaries, Simulink® automatically migrates them to the Architectural Data section of the
Simulink data dictionary. In addition to the Interface
Editor, you can also use the Architectural Data
Editor and Simulink.dictionary.ArchitecturalData
programmatic interfaces to manage and
modify interfaces and value types. For more information on managing architectural data, see
Store Shared Data in Architectural Data Section and Store Data in Architectural Data Section Programmatically.
These concepts are relevant for port interface workflows:
An interface data dictionary is a consolidated list of interfaces and value types in an architecture and where you use them in the architecture.
You can save local interfaces on a System Composer model in an interface data dictionary using the Interface Editor. You can reuse data dictionaries between models that need to use a given set of interfaces, elements, and value types. Data dictionaries that you link to models are stored in separate SLDD files.
A data interface defines the kind of information that flows through a port. The same interface can be assigned to multiple ports. A data interface can be composite, meaning that it can include data elements that describe the properties of an interface signal.
Data 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 data interfaces and data elements and store them in an interface data dictionary for reuse between models.
A data element describes a portion of an interface, such as a communication message, a calculated or measured parameter, or other decomposition of that interface.
Data interfaces are decomposed into data elements:
Pins or wires in a connector or harness.
Messages transmitted across a bus.
Data structures shared between components.
A value type can be used as a port interface to define the atomic piece of data that flows through that port and has a top-level type, dimension, unit, complexity, minimum, maximum, and description.
You can also assign the type of data elements in data interfaces to value types. Add value types to data dictionaries using the Interface Editor so that you can reuse the value types as interfaces or data elements.
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.
An adapter connects two components with incompatible port interfaces by mapping between the two interfaces. An adapter can act as a unit delay, rate transition, or merge. You can also use an adapter for bus creation. Use the Adapter block to implement an adapter.
With an adapter, you can perform functions on the Interface Adapter dialog box:
Create and edit mappings between input and output interfaces.
Apply an interface conversion
UnitDelay
to break an algebraic loop.Apply an interface conversion
RateTransition
to reconcile different sample time rates for reference models.Apply an interface conversion
Merge
to merge two or more message or signal lines.When output interfaces are undefined, you can use input interfaces in bus creation mode to author owned output interfaces.
Tip
To learn more about how System Composer concepts apply to systems engineering design, see System Composer Concepts.
Use interfaces to describe information transmitted across connections through ports between components. The table lists topics about using interfaces.
Topic | Description |
---|---|
Create Interfaces | Design interfaces and nested interfaces in the Interface Editor with data interfaces, data elements, and value types. |
Assign Interfaces to Ports | Assign data interfaces and data elements to ports. Define owned interfaces local to ports. |
Manage Interfaces with Data Dictionaries | Save external interface data dictionaries to reuse between different models, link data dictionaries to architecture models, and delete data interfaces from data dictionaries. |
Reference Data Dictionaries | Reference data dictionaries so you can selectively share interface definitions among models. Manage referenced data dictionaries in the Model Explorer. |
Interface Adapter | Use an Adapter block to help connect two components with incompatible port interfaces by mapping between the two interfaces. |
Note
Connected ports in System Composer are compatible if they share a compatible interface type and structure. Ports without assigned interfaces automatically inherit from other ports on the connection. To activate compile-time checks for interface compatibility, on the toolstrip, click Update Diagram. You can reconcile incompatible interfaces on either end of a connection with an Adapter block using the Interface Adapter.
The architecture model below represents an adapter, an interface data dictionary, a data interface, a data element, and a value type.
Note
System Composer interfaces mirror Simulink interfaces that use buses and value types. When you plan to link Simulink behaviors to System Composer components, consider these resources:
For buses at Simulink interfaces, see Composite Interface Guidelines.
To use model interfaces with bus element ports, see Simplify Subsystem and Model Interfaces with Bus Element Ports.
For value types at Simulink interfaces, see Specify Common Set of Signal Properties as Value Type.