Comparison Functions and Operators

Introduction

Comparison functions and operators compare two or more variables returning a BOOL value (TRUE or FALSE).

Fernhill SCADA supports these comparison functions and operators:

FunctionOperatorDescription
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.

Examples

ExampleReturn Value
1 > 2FALSE
'Abc' = 'Abc'TRUE

Standards Compliance

Table 28 - IEC 61131-3 2nd Edition.

Table 33 - IEC 61131-3 3rd Edition.

Further Information

Common Elements

To learn about other language Common Elements.

Glossary

For definitions of the terms used in Fernhill SCADA.