Skip to main content

Compiler Error C0066

Message: Cannot compare type '<data type>' with type '<data type>'

Possible error cause: Two data types are compared which cannot be compared with each other.

Error correction: Compare only data types that can be compared with each other.

Example 355. Example of the error:
PROGRAM PLC_PRG
VAR
    i : INT;
    re : REAL;
    str: STRING;
    b : BOOL;
END_VAR

b := i > str;

Message:

C0066: Cannot compare type 'INT' with type 'STRING'

Error correction:

b := i > re;