Command ‘Implement interfaces’ΒΆ

Function: This command updates the implemented interfaces for a function block.

Call: Context menu of the selected function block (FB) in the device tree.

Requirement: The function block implements an interface that you have modified. For example, an additional method was added to the interface.

Note

In object-oriented programming, if you derive a function block (FB) from a base function block, which implements one or more interfaces, for the purpose of inheritance, then the following applies:

When you execute the Implement interfaces command for the derived FB, all interface methods and interface attributes of the base FB are accepted into the derived FB in the form of stubs (without implementation). Then you are responsible for making sure that an “empty” method/attribute in the derived FB does not conflict with an implemented one in the base FB. The following actions are taken to support you in this case: If there es a base implementation for a method/attribute, then CODESYS adds a pragma attribute {error..} in the first line of the affected derived interface method or interface attribute that will generate the error message. If there is no base implementation for the method/attribute, then there is a pragma attribute entry for a warning. After editing the block, you must remove the error pragma attribute entry explicitly.

See also