SA0051: Comparison operations on BOOL variables

Function

Determines comparison operations on variables of type BOOL.

Reason

TwinCAT allows such comparisons, but they are rather unusual and can be confusing. The IEC-61131-3 standard does not provide for these comparisons, so you should avoid them.

Importance

Medium

Sample:

PROGRAM MAIN
VAR
    b1       : BOOL;
    b2       : BOOL;
    bResult  : BOOL;
END_VAR
bResult := (b1 > b2);            // => SA0051 
bResult := NOT b1 AND b2;
bResult := b1 XOR b2;