P4100

Code

P4100

Message

Semicolon after a POU header requires choosing a dialect or –allow-pou-header-semicolon flag

This error occurs when a semicolon closes the header of a PROGRAM, FUNCTION, FUNCTION_BLOCK or METHOD before its first variable block, without the --allow-pou-header-semicolon compiler flag.

The IEC 61131-3 standard grammar (Annex B) puts no terminator after a header: the variable blocks follow the name, return type, EXTENDS and IMPLEMENTS directly. A semicolon there is an extension.

A semicolon after the header that a variable block does not follow is the standard empty statement at the start of the body and is always allowed.

Example

The following code will generate error P4100:

FUNCTION_BLOCK FB_Motor EXTENDS FB_Base;
VAR_INPUT
    speed : INT;
END_VAR
END_FUNCTION_BLOCK

To fix this error, remove the semicolon:

FUNCTION_BLOCK FB_Motor EXTENDS FB_Base
VAR_INPUT
    speed : INT;
END_VAR
END_FUNCTION_BLOCK

Or enable the extension:

Pass the --allow-pou-header-semicolon flag to enable it, or select a dialect that includes it. See Enabling Dialects and Features for the dialects and flags reference.

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.