CMP
Compares two values: tells if they are equal, or if the first is less or greater than the second one.

Arguments | ||
---|---|---|
VAL1 | DINT | Any signed integer value |
VAL2 | DINT | Any signed integer value |
LT | BOOL | TRUE if val1 is less than val2 |
EQ | BOOL | TRUE if val1 is equal to val2 |
GT | BOOL | TRUE if val1 is greater than val2 |
Example
(* FBD program using the CMP block *)

(* ST Equivalence: We suppose CMP1 is an instance of CMP block *)
CMP1(level, max_level); pump_cmd := CMP1.LT OR CMP1.EQ; alarm := CMP1.GT AND NOT(manual_mode);
Provide Feedback