Skip to main content

Compiler Error C0197

Message: Implicit conversion from '<data type 1>' to '<data type 2>': possible loss of information

Possible error cause: An attempt is made to convert a variable from data type DINT or LINT to data type REAL.

Error correction: For DINT, use the data type LREAL, and when converting from LINT to LREAL make sure that the value of LINT does not exceed the capacity of LREAL.

Example 425. Example of the error:
PROGRAM PLC_PRG
VAR
    i : DINT;
    b : REAL;
END_VAR
b := i;

Message:

C0197: Implicit conversion from 'DINT' to 'REAL': possible loss of information