31
COMPARISON FUNCTIONS
31.1
Comparing Data
GT(_E), GE(_E), EQ(_E), LE(_E), LT(_E)
RnPCPU
RnCPU RnENCPU
(Process)
These functions output the comparison result of input values.
*1
Ladder, FBD/LD
[Without EN/ENO]
s1
d
s2
*1 The input variable s can be changed within the range from 2 to 28.
*2 The engineering tool with version "1.035M" or later supports the ST. The function is described as an operator when an engineering tool
with an earlier version is used. ( MELSEC iQ-R Programming Manual (Program Design))
Setting data
■Description, type, data type
Argument
EN
*1
s1 (IN1) to s28 (IN28)
ENO
d
*1 DX cannot be used.
Processing details
■Operation processing
• These functions perform comparison operation between the input values to (s), and output the operation result, in the
BOOL data type, from (d).
• GT(_E): Performs comparison of [(s1)>(s2)]&[(s2)>(s3)]&&[(s)
• If all values satisfy (s)
• If one the values satisfies (s)
• GE(_E): Performs comparison of [(s1)(s2)]&[(s2)(s3)]&&[(s)
• If all values satisfy (s)
• If one the values satisfies (s)
• EQ(_E): Performs comparison of [(s1)=(s2)]&[(s2)=(s3)]&&[(s)
• If all values satisfy (s)
• If one the values satisfies (s)
• LE(_E): Performs comparison of [(s1)(s2)]&[(s2)(s3)]&&[(s)
• If all values satisfy (s)
• If one the values satisfies (s)
• LT(_E): Performs comparison of [(s1)<(s2)]&[(s2)<(s3)]&&[(s)
• If all values satisfy (s)
• If one the values satisfies (s)
• Input an INT, DINT, REAL, LREAL, BOOL, WORD, DWORD, TIME, or STRING type data value to (s). No WSTRING type
Unicode string can be specified.
31 COMPARISON FUNCTIONS
1940
31.1 Comparing Data
RnPCPU
RnSFCPU RnSFCPU
(Redundant)
(Standard)
(Safety)
[With EN/ENO]
EN
ENO
s1
s2
Description
Execution condition (TRUE: Executed, FALSE: Not executed)
Input
Output status (TRUE: Normal, FALSE: Abnormal)
Output (TRUE, FALSE)
>(s)
, TRUE is output.
(n-1)
(n)
(s)
, FALSE is output.
(n-1)
(n)
(s)
, TRUE is output.
(n-1)
(n)
<(s)
, FALSE is output.
(n-1)
(n)
=(s)
, TRUE is output.
(n-1)
(n)
(s)
, FALSE is output.
(n-1)
(n)
(s)
, TRUE is output.
(n-1)
(n)
>(s)
, FALSE is output.
(n-1)
(n)
<(s)
, TRUE is output.
(n-1)
(n)
(s)
, FALSE is output.
(n-1)
(n)
Structured text
[Without EN/ENO]
d:=GT(s1,s2);
d:=GE(s1,s2);
d:=EQ(s1,s2);
d:=LE(s1,s2);
d
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);
>(s)
].
(n-1)
(n)
(s)
].
(n-1)
(n)
=(s)
].
(n-1)
(n)
(s)
].
(n-1)
(n)
<(s)
].
(n-1)
(n)
*1
*2
Type
Input variable
Input variable
Output variable
Output variable
Data type
BOOL
ANY_ELEMENTARY
BOOL
BOOL