P4067

Code

P4067

Message

Function block does not provide a member of an interface it implements

This error occurs when a function block type lists an interface in IMPLEMENTS but does not provide one of the interface’s methods or properties.

A function block that implements an interface promises a body for every member the interface declares, including the members of the interfaces it extends. A member inherited from a base type through EXTENDS counts. An ABSTRACT function block must provide the members too, though a METHOD ABSTRACT counts as providing a method.

Example

The following code will generate error P4067:

INTERFACE I_Comm
    METHOD Send : BOOL
    END_METHOD
END_INTERFACE

FUNCTION_BLOCK FB_Serial IMPLEMENTS I_Comm  (* Error: Send is missing *)
END_FUNCTION_BLOCK

To fix this error, declare the member on the function block type:

FUNCTION_BLOCK FB_Serial IMPLEMENTS I_Comm
    METHOD Send : BOOL
        Send := TRUE;
    END_METHOD
END_FUNCTION_BLOCK

See Also

  • IMPLEMENTS — IMPLEMENTS

  • INTERFACE — INTERFACE

  • P4068 — Function block member differs from the interface member it implements

  • P4070 — IMPLEMENTS names a type that is not a declared interface

Think IronPLC is wrong about this?

If you believe this diagnostic is incorrect, open an issue on GitHub with a small sample that demonstrates the problem.