Comparison functions and operators compare two or more variables returning a BOOL value (TRUE or FALSE).
Fernhill SCADA supports these comparison functions and operators:
| Function | Operator | Description |
|---|---|---|
| GT | > | Greater than |
| GE | >= | Greater than or equal to |
| EQ | = | Equal |
| LE | <= | Less than or equal to |
| LT | < | Less than |
| NE | <> | Not equal to |
In IEC 61131-3, all comparison operators can be called as a function using the function table above. For example:
GE( A, B ) is equivalent to A >= B.
All IEC 61131-3 comparison operators, except NE (Not Equal) can be cascaded to operate on 2 or more parameters. For example:
A > B > C returns TRUE if A is greater than B and B is greater than C.
| Example | Return Value |
|---|---|
| 1 > 2 | FALSE |
| 'IoT' = 'IoT' | TRUE |
IEC 61131-3 Second Edition: Table 28.
IEC 61131-3 Third Edition: Table 33.
To learn about other language Common Elements.
For the meaning of terms used in Fernhill SCADA.