P4033

Code

P4033

Message

Partial-access syntax (.%Xn) requires choosing a dialect or –allow-partial-access-syntax flag

This error occurs when a source uses IEC 61131-3:2013 partial-access syntax (.%Xn, .%Bn, .%Wn, .%Dn, or .%Ln) without enabling it. Partial-access syntax is standardized in Edition 3 of IEC 61131-3 but is not part of Edition 2, so it is gated behind the --allow-partial-access-syntax flag.

Example

The following code will generate error P4033:

PROGRAM main
VAR
    b : BYTE;
    r : BOOL;
END_VAR
    r := b.%X0;
END_PROGRAM

To fix this error, either use the Edition 2 short form .n:

r := b.0;

Or enable partial-access syntax:

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

Scope

IEC 61131-3:2013 defines partial access at five granularities — .%Xn (bit), .%Bn (byte), .%Wn (word), .%Dn (double word), and .%Ln (long word). The flag enables all five forms, and all five raise P4033 when the flag is off. Only the bit form has an Edition 2 equivalent (the .n short form); the wider forms have none, so a source that uses them must enable the flag. See Bit Access for the full feature description.

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.