Main Content

Interface Adapter

A source port and its destination port may be defined by different data interfaces. Such a connection can represent an intermediate point in design, where components from different sources come together. To connect components with different data interfaces, use an Adapter block from the component palette and the Interface Adapter.

For interfaces terminology, see Define Port Interfaces Between Components.

An adapter helps connect two components with incompatible port interfaces by mapping between the two interfaces. Use the Adapter block to implement an adapter. Launch the Interface Adapter by double-clicking an Adapter block on the connection between the ports.

Use the Interface Adapter in System Composer™ to map interface elements between two ports. You can also use the Interface Adapter to apply an interface conversion that breaks algebraic loops with unit delays, or insert a rate transition for different sample time rates.

Map Similar Interfaces

When two connected components with Simulink® behaviors have the same number of signals with different names, use an Adapter block and the Interface Adapter to define the port connections.

  1. Add an Adapter block to your model on the connection between the two components.

  2. Double-click the block to open the Interface Adapter dialog box.

  3. In the Select input box, select a data element. In the Select output box, select a data element.

  4. Click the Map button.

Interface adapter block in a model between ports on a connection. The edit interface mappings interface adapter dialog is open.

You can use an Adapter block to map similar interfaces for an N:1 connection (an Adapter with more than one input port and a single output port). A data element from each input connection maps to the output connection data elements.

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

Many to one use of interface adapter and mappings.

Use Unit Delay to Break Algebraic Loop

When connecting two components with port connections in both directions, an algebraic loop can occur. To break the algebraic loop, use an Adapter block to insert a unit delay between the components.

  1. Add an Adapter block to your model on the connection between the two components.

  2. Double-click the block to open the Interface Adapter dialog box.

  3. From the Apply interface conversion list, select UnitDelay.

Use Rate Transition Between Simulink Behaviors

When connecting two reference components, the Simulink models they reference can have different sample time rates. For compatibility, use an Adapter block to insert a rate transition between the components.

  1. Add an Adapter block to your model on the connection between the two components.

  2. Double-click the block to open the Interface Adapter dialog box.

  3. From the Apply interface conversion list, select RateTransition.

See Also

Blocks

Related Topics