Extending a structure

Like function blocks, structures can be extended. The structure then obtains the variables of the basic structure in addition to its own variables.

Creating a structure that extends another structure:

1. Select the PLC project object or a subfolder in the PLC project tree.
2. In the context menu select the command Add > DUT...
The dialog Add DUT opens.
3. Enter a name and select Structure as the data type.
4. Select the Extends option and click the Extending a structure 1: button.
The Input Assistant opens.
5. From the category Data Unit types select the structure to be extended by the new structure.
The structure extends the basic structure.

 

Extending a structure 2:

Multiple inheritance is not allowed

Multiple inheritance is not allowed for structures. It is not possible for a structure to extend more than one other structure.

  • Not possible:
    TYPE ST_Sub EXTENDS ST_Base1, ST_Base2 :
    STRUCT

See also: