810
21 COMPARISON FUNCTIONS
21.1 Compare
21 COMPARISON FUNCTIONS
21.1 Compare
GT(_E), GE(_E), EQ(_E), LE(_E), LT(_E)
These functions output the data comparison result of input values.
*1 The input variable "s" can be changed in the range of 2 to 28.
â– Descriptions, types, and data types
â– Operation processing
• These functions perform a comparison operation of input values of (s) and output operation results from (d) in the BOOL
type.
• A data value of the INT, DINT, REAL, BOOL, WORD, DWORD, TIME, or STRING type can be input to (s).
Ladder diagram
*1
Structured text
*1
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
d:=GT(s1,s2);
d:=GE(s1,s2);
d:=EQ(s1,s2);
d:=LE(s1,s2);
d:=LT(s1,s2);
[With EN/ENO]
d:=GT_E(EN,ENO,s1,s2);
d:=GE_E(EN,ENO,s1,s2);
d:=EQ_E(EN,ENO,s1,s2);
d:=LE_E(EN,ENO,s1,s2);
d:=LT_E(EN,ENO,s1,s2);
Argument Description Type Data type
EN Execution condition (TRUE: Execution, FALSE: Stop) Input variable BOOL
s1 to s28 Input Input variable ANY_SIMPLE
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d Output (TRUE: True value, FALSE: False value) Output variable BOOL
• GT(_E): These functions compare [(s1)>(s2)]&[(s2)>(s3)]&&[(s)
(n-1)
>(s)
(n)
].
• When all the operation results are (s)
(n-1)
>(s)
(n)
, these functions output TRUE.
• When any of the operation results is (s)
(n-1)
ï‚£(s)
(n)
, these functions output FALSE.
• GE(_E): These functions compare [(s1)(s2)]&[(s2)(s3)]&&[(s)
(n-1)
(s)
(n)
].
• When all the operation results are (s)
(n-1)
(s)
(n)
, these functions output TRUE.
• When any of the operation result is (s)
(n-1)
<(s)
(n)
, these functions output FALSE.
• EQ(_E): These functions compare [(s1)=(s2)]&[(s2)=(s3)]&&[(s)
(n-1)
=(s)
(n)
].
• When all the operation results are (s)
(n-1)
=(s)
(n)
, these functions output TRUE.
• When any of the operation results is (s)
(n-1)
(s)
(n)
, these functions output FALSE.
• LE(_E): These functions compare [(s1)(s2)]&[(s2)(s3)]&&[(s)
(n-1)
ï‚£(s)
(n)
].
• When all the operation results are (s)
(n-1)
ï‚£(s)
(n)
, these functions output TRUE.
• When any of the operation result is (s)
(n-1)
>(s)
(n)
, these functions output FALSE.
• LT(_E): These functions compare [(s1)<(s2)]&[(s2)<(s3)]&&[(s)
(n-1)
<(s)
(n)
].
• When all the operation results are (s)
(n-1)
<(s)
(n)
, these functions output TRUE.
• When any of the operation results is (s)
(n-1)
(s)
(n)
, these functions output FALSE.