Compiler Error C0003

Message

‘<value>’ is not a valid bit number for ‘<variable>’

Message Cause

Attempted access to a bit that is outside the range for a data type.

Solution

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

Error Example

PROGRAM PLC_PRG
VAR
 test1: BOOL;
 test2: WORD;
END_VAR

test1 := test2.17;

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