Wiki source code of 11 Contact comparison

Last modified by Wecon on 2025/09/03 21:03

Show last authors
1 == **Signed 16-bit contact comparison instruction** ==
2
3 **LD **◻**, AND **◻**, OR **◻
4
5 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.
6
7 LD◻: Normally open contact comparison instruction
8
9 AND◻: Normally open contact series connection comparison instruction
10
11 OR◻: Normally open contact parallel connection comparison instruction
12
13 **Ladder diagram**
14
15 (% style="text-align:center" %)
16 [[image:07-5 Basic instructions_html_63210db6b7e1512f.png]]
17
18 (You can enter "=", "<>", ">", "<", ">=", "<=" in ◻)
19
20 **Content, range and data type**
21
22 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
23 |(s1)|Comparison data or device storing comparison data|-32768 to 32767|Signed BIN 16 bit|ANY16_S
24 |(s2)|Comparison data or device storing comparison data|-32768 to 32767|Signed BIN 16 bit|ANY16_S
25
26 **Device used**
27
28 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="11" %)**Devices**|(((
29 **Offset modification**
30 )))|(((
31 **Pulse extension**
32 )))
33 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
34 |LD=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
35 |LD>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
36 |LD<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
37 |LD>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
38 |LD<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
39 |LD<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
40 |AND=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
41 |AND>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
42 |AND<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
43 |AND>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
44 |AND<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
45 |AND<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
46 |OR=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
47 |OR>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
48 |OR<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
49 |OR>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
50 |OR<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
51 |OR<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
52
53 **Features**
54
55 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.
56
57 The comparison operation result of each instruction is shown below.
58
59 |**Instruction Sign**|**Condition**|**Comparison operation result**|**Instruction Sign**|**Condition**|**Comparison operation result**
60 |==|(s1)=(s2)|(% rowspan="6" %)On state|==|(s1)≠(s2)|(% rowspan="6" %)Non-conduction state
61 |<>|(s1)≠(s2)|<>|(s1)=(s2)
62 |>|(s1)>(s2)|>|(s1)≤(s2)
63 |<|(s1)<(s2)|<|(s1)≥(s2)
64 |>=|(s1)≥(s2)|>=|(s1)<(s2)
65 |<=|(s1)≤(s2)|<=|(s1)>(s2)
66
67 **Error code**
68
69 |**Error code**|**Content**
70 |4085H|(s) read address exceeds the device range
71
72 **Example**
73
74 (((
75 (1) LD◻ instruction:
76
77 (% style="text-align:center" %)
78 [[image:07-5 Basic instructions_html_1309199eccc7134.png]]
79 )))
80
81 When the current value of counter C10 is 200, Y10 is set
82
83 When the content of D200 is above -29, and X1 is ON, Y11 is set
84
85 (2) AND◻ instruction:
86
87 (% style="text-align:center" %)
88 [[image:07-5 Basic instructions_html_1c966f74b0bd808e.png]]
89
90 (((
91 When X0 is ON, or when the current value of counter C10 is 200, Y10 is set
92
93 When X1 is OFF, and the content of data counter D0 is not -10, Y11 is set
94
95
96 )))
97
98 (3) OR◻ instruction:
99
100 (% style="text-align:center" %)
101 [[image:07-5 Basic instructions_html_8b000809015ea436.png]]
102
103 (((
104 When X1 is ON, or when the current value of counter C10 is 200, Y0 is set
105
106 When X2 and M30 are ON, or the content of register D100 is K10000 and above, M60 is set
107 )))
108
109 == **Signed 32-bit contact comparison instruction** ==
110
111 **LDD **◻**, ANDD **◻**, ORD **◻
112
113 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.
114
115 LDD◻: Normally open contact comparison command
116
117 ANDD◻: Normally open contact series link comparison instruction
118
119 ORD◻: Normally open contact parallel link comparison instruction
120
121 **Ladder diagram**
122
123 (% style="text-align:center" %)
124 [[image:07-5 Basic instructions_html_63210db6b7e1512f.png]]
125
126 “=”, “<>”, “>”, “<”, “>=”, “<=” can be input in “◻”
127
128 **Content, range and data type**
129
130 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
131 |(s1)|Comparison data or device storing comparison data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S
132 |(s2)|Comparison data or device storing comparison data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S
133
134 **Device used**
135
136 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="13" %)**Devices**|(((
137 **Offset modification**
138 )))|(((
139 **Pulse extension**
140 )))
141 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**[D]**|**XXP**
142 |LDD=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
143 |LDD>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
144 |LDD<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
145 |LDD>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
146 |LDD<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
147 |LDD<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
148 |ANDD=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
149 |ANDD>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
150 |ANDD<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
151 |ANDD>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
152 |ANDD<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
153 |ANDD<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
154 |ORD=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
155 |ORD>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
156 |ORD<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
157 |ORD>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
158 |ORD<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
159 |ORD<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
160
161 **Features**
162
163 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.
164
165 The comparison operation result of each instruction is shown below.
166
167 |**Instruction Sign**|**Condition**|**Comparison operation result**|**Instruction Sign**|**Condition**|**Comparison operation result**
168 |==|(s1)=(s2)|(% rowspan="6" %)On state|==|(s1)≠(s2)|(% rowspan="6" %)Non-conduction state
169 |<>|(s1)≠(s2)|<>|(s1)=(s2)
170 |>|(s1)>(s2)|>|(s1)≤(s2)
171 |<|(s1)<(s2)|<|(s1)≥(s2)
172 |>=|(s1)≥(s2)|>=|(s1)<(s2)
173 |<=|(s1)≤(s2)|<=|(s1)>(s2)
174
175 **Error code**
176
177 |**Error code**|**Content**
178 |4085H|(S) read address exceeds the device range
179
180 **Example**
181
182 (1) LDD◻ instruction:
183
184 (% style="text-align:center" %)
185 [[image:07-5 Basic instructions_html_8acf0d489297c561.png]]
186
187 When the data of LC10 is 200000, Y10 is set, otherwise Y10 is reset.
188
189 When the 32-bit data composed of D201 and D200 exceeds -5000, and X1 is ON, Y11 is turned ON.
190
191 (2) ANDD◻ instruction:
192
193 (% style="text-align:center" %)
194 [[image:07-5 Basic instructions_html_38be93eec0ced6c.png]]
195
196 When X0 is ON and the value of LC10 is 200000, Y10 is set, otherwise it is reset.
197
198 When X1 is OFF and the 32-bit data composed of D1 and D0 is not equal to K-50000, Y11 is set.
199
200 (3) ORD◻ instruction:
201
202 (% style="text-align:center" %)
203 [[image:07-5 Basic instructions_html_8ebfc7b0562cf370.png]]
204
205 When X1 is ON, or the data of LC10 is equal to the data of LC10 is equal to 200000, Y0 is set.
206
207 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.
208
209 == **Single precision real number contact comparison instruction** ==
210
211 **LDE **◻**, ANDE **◻**, ORE **◻
212
213 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.
214
215 LDE◻: Normally open contact comparison command
216
217 ANDE◻: Normally open contact series link comparison instruction
218
219 ORE◻: Normally open contact parallel link comparison instruction
220
221 **Ladder diagram**
222
223 (% style="text-align:center" %)
224 [[image:07-5 Basic instructions_html_6ac28f30e24ad296.png||height="352" width="550"]]
225
226 “=”, “<>”, “>”, “<”, “>=”, “<=” can be input in “◻”
227
228 **Content, range and data type**
229
230 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
231 |(s1)|Comparison data or the device start number storing the comparison data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32
232 |(s2)|Comparison data or the device start number storing the comparison data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32
233
234 **Device used**
235
236 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|(((
237 **Offset modification**
238 )))|(((
239 **Pulse extension**
240 )))
241 |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP**
242 |LDE=|s1, s2|●|●|●|●|●|●|●|●|●|
243 |LDE>|s1, s2|●|●|●|●|●|●|●|●|●|
244 |LDE<|s1, s2|●|●|●|●|●|●|●|●|●|
245 |LDE>=|s1, s2|●|●|●|●|●|●|●|●|●|
246 |LDE<=|s1, s2|●|●|●|●|●|●|●|●|●|
247 |LDE<>|s1, s2|●|●|●|●|●|●|●|●|●|
248 |ANDE=|s1, s2|●|●|●|●|●|●|●|●|●|
249 |ANDE>|s1, s2|●|●|●|●|●|●|●|●|●|
250 |ANDE<|s1, s2|●|●|●|●|●|●|●|●|●|
251 |ANDE>=|s1, s2|●|●|●|●|●|●|●|●|●|
252 |ANDE<=|s1, s2|●|●|●|●|●|●|●|●|●|
253 |ANDE<>|s1, s2|●|●|●|●|●|●|●|●|●|
254 |ORE=|s1, s2|●|●|●|●|●|●|●|●|●|
255 |ORD>|s1, s2|●|●|●|●|●|●|●|●|●|
256 |ORE<|s1, s2|●|●|●|●|●|●|●|●|●|
257 |ORE>=|s1, s2|●|●|●|●|●|●|●|●|●|
258 |ORE<=|s1, s2|●|●|●|●|●|●|●|●|●|
259 |ORE<>|s1, s2|●|●|●|●|●|●|●|●|●|
260
261 **Features**
262
263 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.
264
265 The comparison operation result of each instruction is shown below.
266
267 |**Instruction Sign**|**Condition**|**Comparison operation result**|**Instruction Sign**|**Condition**|**Comparison operation result**
268 |E=|(s1)=(s2)|(% rowspan="6" %)On state|E=|(s1)≠(s2)|(% rowspan="6" %)Non-conduction state
269 |E<>|(s1)≠(s2)|E<>|(s1)=(s2)
270 |E>|(s1)>(s2)|E>|(s1)≤(s2)
271 |E<|(s1)<(s2)|E<|(s1)≥(s2)
272 |E>=|(s1)≥(s2)|E>=|(s1)<(s2)
273 |E<=|(s1)≤(s2)|E<=|(s1)>(s2)
274
275 **Error code**
276
277 |**Error code**|**Content**
278 |4084H|When the content of the specified device by (s1) and (s2) is an irregular number, a non-number, or ±∞
279 |4085H|The read address of (s1) and (s2exceeds the device range
280
281 **Example**
282
283 (1) LDE◻ instruction:
284
285 (% style="text-align:center" %)
286 [[image:07-5 Basic instructions_html_c4c820cf59601493.png]]
287
288 When the real number input in D0 is equal to E1.23, Y10 is ON, otherwise Y10 is OFF.
289
290 When the real number in R0 is greater than or equal to the real number in LC0, Y11 is ON, otherwise it is OFF.
291
292 If the input in D0, R0, LC0 is not a real number, it will report H4084 error.
293
294 (2) ANDE◻ instruction:
295
296 (% style="text-align:center" %)
297 [[image:07-5 Basic instructions_html_7cdd2117360e179b.png]]
298
299 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.
300
301 (3) ORE◻ instruction:
302
303 (% style="text-align:center" %)
304 [[image:07-5 Basic instructions_html_3eba0bd56176441d.png]]
305
306 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.
307
308 == **String comparison** ==
309
310 **LDS**◻**、ANDS**◻**、 ORS**◻
311
312 Compare the string stored after the device number specified in (s1) with the string stored after the device number specified in (s2).
313
314 LDS◻: String comparison instruction
315
316 ANDS◻: String serial connection comparison instruction
317
318 ORS◻: String parallel connection comparison instruction
319
320 **Ladder diagram**
321
322 (% style="text-align:center" %)
323 [[image:07-5 Basic instructions_html_5fb3b3b70645fef5.png||height="371" width="550"]]
324
325 “=” and “<>” could be entered in “◻”
326
327 **Content, range and data type**
328
329 |**Parameter**|**Content**|**Range**|**Date type**|**Date type(label)**
330 |(S1)|Connection data or the device start number storing the data or the string specified directly|-|String|ANYSTRING_SINGLE
331 |(S1)|Connection data or the device start number storing the data or the string specified directly|-|String|ANYSTRING_SINGLE
332
333 **Device used**
334
335 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="9" %)**Devices**|(((
336 **Offset modification**
337 )))|(((
338 **Pulse extension**
339 )))
340 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
341 |LDS=|s1、s2|●|●|●|●|●|●|●|●|●|●|
342 |LDS<>|s1、s2|●|●|●|●|●|●|●|●|●|●|
343 |ANDS=|s1、s2|●|●|●|●|●|●|●|●|●|●|
344 |ANDS<>|s1、s2|●|●|●|●|●|●|●|●|●|●|
345 |ORS=|s1、s2|●|●|●|●|●|●|●|●|●|●|
346 |ORS<>|s1、s2|●|●|●|●|●|●|●|●|●|●|
347
348 **Features**
349
350 • Compare the string stored after the device number specified in (s1) with the string stored after the device number specified in (s2).
351
352 • The comparison operation result of each instruction is shown below.
353
354 |**Instruction sign**|**Condition**|**Comparison operation result**|**Instruction sign**|**Condition**|**Comparison operation result**
355 |==|(s1)=(s2)|(% rowspan="2" %)On stat|==|(s1)≠(s2)|(% rowspan="2" %)Non-conduction state
356 |<>|(s1)≠(s2)|<>|(s1)=(s2)
357
358 **Error code**
359
360 |**Error code**|**Content**
361 |4085H|The read address of (s1) or (s2) exceeds the device range
362 |408AH|The length of the read string of (s1) or (s2) exceeds, and the continuous length of the string exceeds 400 characters.
363 |408BH|When (s1) or (s2) reading the string, the maximum range of the device is read but 00H is not found as the end.
364
365 **Example**
366
367 (1) LDS◻ instruction:
368
369 (% style="text-align:center" %)
370 [[image:07-5 Basic instructions_html_449a071f61ff5b58.png]]
371
372 (2) ANDS◻ instruction:
373
374 (% style="text-align:center" %)
375 [[image:07-5 Basic instructions_html_dd6aa995d193bdd2.png]]
376
377 (3) ORS◻ instruction:
378
379 (% style="text-align:center" %)
380 [[image:07-5 Basic instructions_html_4f8fb7c94f87c58d.png]]