Skip to main content

Compiler Error C0003

Message: '<value>' is not a valid bit number for '<variable>'

Possible error cause: Attempted access to a bit that is outside of the range for a data type.

Error correction: Use a bit value for the bit access that is lower than the number of bits in the data type of the variable.

Example 313. Example of the error:
PROGRAM PLC_PRG
VAR
    test1: WORD;
    test2: BOOL;
END_VAR

test1 := test2.17;

Message:

C0003: '17' is not a valid bit number for 'w'