P4070¶
- Code
P4070
- Message
IMPLEMENTS names a type that is not a declared interface
This error occurs when a function block type lists a name in
IMPLEMENTS that is not a declared interface: the name is not declared at
all, or it names another kind of type, such as a function block or a
structure.
Only an interface can be implemented. To inherit from a function block, use
EXTENDS.
Example¶
The following code will generate error P4070:
FUNCTION_BLOCK FB_Base
END_FUNCTION_BLOCK
FUNCTION_BLOCK FB_Motor IMPLEMENTS FB_Base (* Error: FB_Base is not an interface *)
END_FUNCTION_BLOCK
To fix this error, name a declared interface, or extend the function block instead:
FUNCTION_BLOCK FB_Motor EXTENDS FB_Base
END_FUNCTION_BLOCK
See Also¶
IMPLEMENTS —
IMPLEMENTSINTERFACE —
INTERFACEP4067 — Function block does not provide a member of an interface it implements
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.