Compiler Error C0001

Message

Constant ‘<constant value>’ too large for type ‘<data type>’

Message Cause

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

Solution

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

Error Example

PROGRAM PLC_PRG
VAR
  test1: INT;
  test2: INT;
  test3: LREAL;
END_VAR

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

--> 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_LREAL'