GFK-0467K Chapter 4 Series 90-30/20/Micro Instructions Set 4-41
4
Section 4: Relational Functions
Relational functions are used to compare two numbers. This section describes the following
relational functions:
Abbreviation Function Description Page
EQ Equal Test two numbers for equality. 4-41
NE Not Equal Test two numbers for non-equality. 4-41
GT Greater Than Test for one number greater than another. 4-41
GE Greater Than
or Equal
Test for one number greater than or equal to another. 4-41
LT Less Than Test for one number less than another. 4-41
LE Less Than
or Equal
Test for one number less than or equal to another. 4-41
RANGE Range Determine whether a number is within a specified range
(available for Release 4.5 or higher CPUs).
4-44
Relational functions are used to determine the relation of two values. When the function receives
power flow, it compares input parameter I1 to input parameter I2. These parameters must be the
same data type. Relational functions operate on these types of data:
Data Type Description
INT Signed integer.
DINT Double precision signed integer.
REAL Floating Point
Note
The REAL data type is only available on the 350 and 360 series CPUs, Release 9
or later, or on all releases of CPU352. Also, the Range function block does not
accept REAL type. Additionally, the %S0020 bit is set ON when a relational
function using REAL data executes successfully. It is cleared when either input is
NaN (Not a Number).
The default data type is signed integer. To compare either signed integers, double precision signed
integers, or real numbers select the new data type after selecting the relational function. To
compare data of other types or of two different types, first use the appropriate conversion function
(described in section 8, “Conversion Functions”) to change the data to one of the supported types.
If input parameters I1 and I2 match the specified relation, output Q receives power flow and is set
ON (1); otherwise, it is set OFF (0).
_____
| |
(enable) —| EQ
_
|
| |
| INT |
| |
(input parameter I1) —|I1 Q|— (output parameter Q)
| |
| |
(input parameter I2) —|I2 |
|_____|