Skip to main content

Compiler Error C0001

Message: Constant '<constant value>‘ too large for type '<data type>‘

Possible error cause: A typed constant is too large for the given data type or a constant is too large for each possible data type.

Error correction: Use smaller constants or an appropriate data type for a typed constant.

Example 311. Example of the error:
PROGRAM PLC_PRG
VAR
    test1: INT;
    test2: INT;
    test3: LREAL;
END_VAR

test1 := 12345678912345566991923939292939911;
test2 := INT#123456;
test3 := 10E500;

Message:

C0001: Constant '12345678912345566991923939292939911' too large for type 'ANY_INT'

C0001: Constant 'INT#123456' too large for type 'INT'

C0001: Constant '10E500' too large for type 'ANY_REAL'