E165 - Implicit conversion between BOOL and numbers
A number is assigned to a BOOL. The value is not limited to 0 and 1, so the result depends on the
representation of the number. The literals 0 and 1 are accepted.
Code example:
PROGRAM mainProg
VAR
flags : BYTE := 2;
active : BOOL;
END_VAR
active := flags; // warning
active := flags <> 0;
END_PROGRAM
To silence the warning, compare the number explicitly:
active := flags <> 0;