11 Contact comparison
Signed 16-bit contact comparison instruction
LD ◻, AND ◻, OR ◻
The BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2) are compared by normal open contact processing.
LD◻: Normally open contact comparison instruction
AND◻: Normally open contact series connection comparison instruction
OR◻: Normally open contact parallel connection comparison instruction
Ladder diagram
(You can enter "=", "<>", ">", "<", ">=", "<=" in ◻)
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(s1) | Comparison data or device storing comparison data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
(s2) | Comparison data or device storing comparison data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
LD= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LD> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LD< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LD>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LD<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LD<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
AND= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
AND> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
AND< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
AND>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
AND<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
AND<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
OR= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
OR> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
OR< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
OR>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
OR<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
OR<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
The BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2) are compared by normal open contact processing.
The comparison operation result of each instruction is shown below.
Instruction Sign | Condition | Comparison operation result | Instruction Sign | Condition | Comparison operation result |
= | (s1)=(s2) | On state | = | (s1)≠(s2) | Non-conduction state |
---|---|---|---|---|---|
<> | (s1)≠(s2) | <> | (s1)=(s2) | ||
> | (s1)>(s2) | > | (s1)≤(s2) | ||
< | (s1)<(s2) | < | (s1)≥(s2) | ||
>= | (s1)≥(s2) | >= | (s1)<(s2) | ||
<= | (s1)≤(s2) | <= | (s1)>(s2) |
Error code
Error code | Content |
4085H | (s) read address exceeds the device range |
Example
(1) LD◻ instruction:
When the current value of counter C10 is 200, Y10 is set
When the content of D200 is above -29, and X1 is ON, Y11 is set
(2) AND◻ instruction:
When X0 is ON, or when the current value of counter C10 is 200, Y10 is set
When X1 is OFF, and the content of data counter D0 is not -10, Y11 is set
(3) OR◻ instruction:
When X1 is ON, or when the current value of counter C10 is 200, Y0 is set
When X2 and M30 are ON, or the content of register D100 is K10000 and above, M60 is set
Signed 32-bit contact comparison instruction
LDD ◻, ANDD ◻, ORD ◻
The BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2) are compared by normal open contact processing.
LDD◻: Normally open contact comparison command
ANDD◻: Normally open contact series link comparison instruction
ORD◻: Normally open contact parallel link comparison instruction
Ladder diagram
“=”, “<>”, “>”, “<”, “>=”, “<=” can be input in “◻”
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(s1) | Comparison data or device storing comparison data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
(s2) | Comparison data or device storing comparison data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
LDD= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDD> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDD< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDD>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDD<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDD<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDD= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDD> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDD< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDD>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDD<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDD<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORD= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORD> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORD< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORD>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORD<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORD<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
The BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2) are compared by normal open contact processing.
The comparison operation result of each instruction is shown below.
Instruction Sign | Condition | Comparison operation result | Instruction Sign | Condition | Comparison operation result |
= | (s1)=(s2) | On state | = | (s1)≠(s2) | Non-conduction state |
---|---|---|---|---|---|
<> | (s1)≠(s2) | <> | (s1)=(s2) | ||
> | (s1)>(s2) | > | (s1)≤(s2) | ||
< | (s1)<(s2) | < | (s1)≥(s2) | ||
>= | (s1)≥(s2) | >= | (s1)<(s2) | ||
<= | (s1)≤(s2) | <= | (s1)>(s2) |
Error code
Error code | Content |
4085H | (S) read address exceeds the device range |
Example
(1) LDD◻ instruction:
When the data of LC10 is 200000, Y10 is set, otherwise Y10 is reset.
When the 32-bit data composed of D201 and D200 exceeds -5000, and X1 is ON, Y11 is turned ON.
(2) ANDD◻ instruction:
When X0 is ON and the value of LC10 is 200000, Y10 is set, otherwise it is reset.
When X1 is OFF and the 32-bit data composed of D1 and D0 is not equal to K-50000, Y11 is set.
(3) ORD◻ instruction:
When X1 is ON, or the data of LC10 is equal to the data of LC10 is equal to 200000, Y0 is set.
When X2 and M30 are set, or the double word data composed of D101 and D100 is greater than or equal to 100000, M60 is set.
Single precision real number contact comparison instruction
LDE ◻, ANDE ◻, ORE ◻
The single precision real number of the device specified in (s1) and the single precision real number of the device specified in (s2) are compared by normal open contact processing.
LDE◻: Normally open contact comparison command
ANDE◻: Normally open contact series link comparison instruction
ORE◻: Normally open contact parallel link comparison instruction
Ladder diagram
“=”, “<>”, “>”, “<”, “>=”, “<=” can be input in “◻”
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(s1) | Comparison data or the device start number storing the comparison data | 0, 2-126 ≤|(s)|< 2128 | Single precision real number | ANYREAL_32 |
(s2) | Comparison data or the device start number storing the comparison data | 0, 2-126 ≤|(s)|< 2128 | Single precision real number | ANYREAL_32 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||
T | C | D | R | SD | LC | HSC | E | [D] | XXP | ||
LDE= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDE> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDE< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDE>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDE<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDE<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDE= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDE> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDE< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDE>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDE<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDE<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORE= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORD> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORE< | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORE>= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORE<= | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORE<> | s1, s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
The single precision real number of the device specified in (s1) and the single precision real number of the device specified in (s2) are compared by normal open contact processing.
The comparison operation result of each instruction is shown below.
Instruction Sign | Condition | Comparison operation result | Instruction Sign | Condition | Comparison operation result |
E= | (s1)=(s2) | On state | E= | (s1)≠(s2) | Non-conduction state |
E<> | (s1)≠(s2) | E<> | (s1)=(s2) | ||
E> | (s1)>(s2) | E> | (s1)≤(s2) | ||
E< | (s1)<(s2) | E< | (s1)≥(s2) | ||
E>= | (s1)≥(s2) | E>= | (s1)<(s2) | ||
E<= | (s1)≤(s2) | E<= | (s1)>(s2) |
Error code
Error code | Content |
4084H | When the content of the specified device by (s1) and (s2) is an irregular number, a non-number, or ±∞ |
4085H | The read address of (s1) and (s2exceeds the device range |
Example
(1) LDE◻ instruction:
When the real number input in D0 is equal to E1.23, Y10 is ON, otherwise Y10 is OFF.
When the real number in R0 is greater than or equal to the real number in LC0, Y11 is ON, otherwise it is OFF.
If the input in D0, R0, LC0 is not a real number, it will report H4084 error.
(2) ANDE◻ instruction:
Only when M0 is ON and D2 real number is not equal to E1.23 and R2 real number is less than real number LC2 , Y12 is ON, otherwise all are OFF.
(3) ORE◻ instruction:
When the real number of R4 is less than or equal to the real number of R15, or the real number R6 is equal to the real number R20, Y13 is ON, otherwise Y13 is OFF.
String comparison
LDS◻、ANDS◻、 ORS◻
Compare the string stored after the device number specified in (s1) with the string stored after the device number specified in (s2).
LDS◻: String comparison instruction
ANDS◻: String serial connection comparison instruction
ORS◻: String parallel connection comparison instruction
Ladder diagram
“=” and “<>” could be entered in “◻”
Content, range and data type
Parameter | Content | Range | Date type | Date type(label) |
(S1) | Connection data or the device start number storing the data or the string specified directly | - | String | ANYSTRING_SINGLE |
(S1) | Connection data or the device start number storing the data or the string specified directly | - | String | ANYSTRING_SINGLE |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | [D] | XXP | ||
LDS= | s1、s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
LDS<> | s1、s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDS= | s1、s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ANDS<> | s1、s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORS= | s1、s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
ORS<> | s1、s2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
• Compare the string stored after the device number specified in (s1) with the string stored after the device number specified in (s2).
• The comparison operation result of each instruction is shown below.
Instruction sign | Condition | Comparison operation result | Instruction sign | Condition | Comparison operation result |
= | (s1)=(s2) | On stat | = | (s1)≠(s2) | Non-conduction state |
---|---|---|---|---|---|
<> | (s1)≠(s2) | <> | (s1)=(s2) |
Error code
Error code | Content |
4085H | The read address of (s1) or (s2) exceeds the device range |
408AH | The length of the read string of (s1) or (s2) exceeds, and the continuous length of the string exceeds 400 characters. |
408BH | When (s1) or (s2) reading the string, the maximum range of the device is read but 00H is not found as the end. |
Example
(1) LDS◻ instruction:
(2) ANDS◻ instruction:
(3) ORS◻ instruction: