Skip to main content

Element: Interface

_uml_img_interface_selected.png

An interface is a set of methods and property declarations that describe a publicly visible behavior. Thus it does not include any variables or implementation. A specialist relationship (generalization) can exist between two interfaces.

Table 1. Display

(1)

Command icons: Visible when the element is selected

(2)

. Header
  • Identification of the element

    • <<interface>>

    • <<library>>: Interface from a library

    • <<missing>>: Interface from a library which is not integrated in the project

  • Name of the interface

(3)

List of the _cds_icon_interface_property.png interface property

<property name> : <data> {property}

(4)

List of methods

<method name>() : <return type>



Properties

Identifier

Unique name for the element

Tip

You can also change the name in the class diagram by selecting the name and clicking again to open the line editor.

User input

Action

Result

Select the itfData interface, for example, and then click _uml_icon_delete_shallow.png for the itfData interface.

The interface is deleted from the class diagram only. The object remains in the project.

Tip

After being deleted, the interface is displayed in the ToolBox view in Incoming cross references or Outgoing cross references. The requirement for this is that you select an element in the class diagram that has a relationship to the deleted interface.

Click _uml_icon_delete_deep.png.

The interface is removed from the class diagram and from the project.

  1. Click _uml_icon_generalization.png for the itfData interface.

  2. Click a blank area in the diagram.

    The Add Interface dialog opens.

  3. Specify a name for the new interface.

    Note

    Note that the defaults in the Add Interface dialog originate from the last the use of the dialog.

    itfData_Base

  4. Click Add to exit the dialog.

A generalization (EXTENDS) points from the first interface to the new one. The existing interface extends the new one.

In itfData, the extension of itfData_Base has been added.

INTERFACE itfData EXTENDS itfData_Base
  1. Click _uml_icon_generalization.png for the itfData interface.

  2. Click an existing interface.

A generalization points to the existing interface from the new interface.

INTERFACE Itf_1 EXTENDS Itf_2 has been inserted in the declaration.

  1. Click the interface name.

    The name is outlined in blue after the first click.

  2. Click it a second time.

    After you click the second time, an input field opens for changing the name.

The object name (in the device tree or in the POUs view) has been automatically adapted in the declaration.

Double-click an interface.

The corresponding object editor opens.

Example

Example 10. Generalization

Itf_A inherits from Itf_Base:

_uml_img_example_generalization_interface.png
INTERFACE Itf_A EXTENDS Itf_Base