Wiki source code of 01 Transfer and comparison

Version 32.1 by Mora Zhou on 2023/11/22 16:03

Hide last authors
Leo Wei 26.1 1 == MOV/16-bit transmission ==
Leo Wei 1.1 2
3 **MOV(P)**
4
5 Transfer the BIN 16-bit data of the device specified in (S) to the device specified in (D).
6
7 -[MOV (S) (D)]
8
9 **Content, range and data type**
10
Leo Wei 26.1 11 |=(% scope="row" %)Parameter|=Content|=Range|=Data type|=Data type (label)
12 |=(S)|Transmit source data or the device number stored data|-32768 to 32767|Signed BIN16|ANY16_S
13 |=(D)|Transmit destination device number|-|Signed BIN16|ANY16_S
Leo Wei 1.1 14
15 **Device used**
16
Leo Wei 26.2 17 |=(% rowspan="2" scope="row" %)Instruction|=(% rowspan="2" %)Parameter|=(% colspan="11" %)Devices|=Offset modification|=Pulse extension
Leo Wei 29.1 18 |KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|[D]|XXP
Leo Wei 26.2 19 |=(% rowspan="2" %)MOV|=Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●|●
20 |=Parameter 2| |●|●|●|●|●|●|●|●| | |●|●
Leo Wei 1.1 21
22 **Features**
23
24 • Transfer the BIN 16-bit data specified in (S) to the device specified in (D).
25
Leo Wei 26.1 26
Leo Wei 1.1 27 [[image:07-1 Basic instructions_html_608d557cd7a9b085.png||height="178" width="700"]]
28
29 **Error code**
30
Leo Wei 29.1 31 |=(% scope="row" %)Error code|=Content
32 |=4085H|The output result of (S) in read application instruction exceeds the device range
33 |=4086H|The output result of (D) in write application instruction exceeds the device range
Leo Wei 1.1 34
35 **Example**
36
Leo Wei 26.1 37
Leo Wei 1.1 38 [[image:07-1 Basic instructions_html_49a2ba67b393cca0.png]]
39
40 When M0 is set, the value of D0 is transferred to the value of D2: (D0)→(D2).
41
Leo Wei 26.1 42 == DMOV/32-bit transmission ==
Leo Wei 1.1 43
44 **DMOV(P)**
45
46 Transfer the BIN 32-bit data of the device specified in (S) to the device specified in (D).
47
48 -[DMOV (S) (D)]
49
50 **Content, range and data type**
51
Leo Wei 30.1 52 |=(% scope="row" %)Parameter|=Content|=Range|=Data type|=Data type (label)
53 |=(S)|Transmit source data or the device number stored data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
54 |=(D)|Transmit destination device number|-|Signed BIN32|ANY32_S
Leo Wei 1.1 55
56 **Device used**
57
Leo Wei 30.1 58 |=(% rowspan="2" scope="row" %)Instruction|=(% rowspan="2" %)Parameter|=(% colspan="13" %)Devices|=Offset modification|=Pulse extension
Leo Wei 26.1 59 |KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|[D]|XXP
Leo Wei 30.1 60 |=(% rowspan="2" %)DMOV|=Parameter 1|●|●|●|●|●|●|●|●|●| | |●|●|●|●
61 |=Parameter 2| |●|●|●|●|●|●|●|●|●|●| | |●|●
Leo Wei 1.1 62
63 **Features**
64
65 Transfer the BIN 16-bit data specified in (S) to the device specified in (D).
66
Leo Wei 26.1 67
Leo Wei 1.1 68 [[image:07-1 Basic instructions_html_a7a87e4ee0331a3.png||height="248" width="725"]]
69
70 **Error code**
71
Leo Wei 26.1 72 |Error code|Content
73 |4085H|The output result of (S) in read application instruction exceeds the device range
74 |4086H|The output result of (D) in write application instruction exceeds the device range
Leo Wei 1.1 75
76 **Example**
77
Leo Wei 26.1 78
Leo Wei 1.1 79 [[image:07-1 Basic instructions_html_cbab7254f3dd95a9.png]]
80
81 When M0 is set, the value of (D1, D0) is transferred to the value of (D3, D2): (D1, D0) → (D3, D2).
82
Leo Wei 26.1 83 == BMOV/Batch transmission ==
Leo Wei 1.1 84
85 **BMOV(P)**
86
87 The (N) point BIN 16-bit data starting from the device specified in (S) is sequentially transmitted to the device specified in (D).
88
89 -[BMOV (S) (D) (N)]
90
91 **Content, range and data type**
92
Leo Wei 26.1 93 |Parameter|Content|Range|Data type|Data type (label)
94 |(S)|The start device that stores the transmission data|-|Signed BIN16|ANY16_S
95 |(D)|The start device that transmit target|-|Signed BIN16|ANY16_S
96 |(N)|Number of transmission|1 ≤ N ≤ 512|Signed BIN16|ANY16_S
Leo Wei 1.1 97
98 **Device used**
99
Leo Wei 26.1 100 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="11" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Joey 5.1 101 **Pulse extension**
Leo Wei 1.1 102 )))
Leo Wei 26.1 103 |KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|[D]|XXP
104 |(% rowspan="3" style="text-align:center; vertical-align:middle" %)BMOV|Parameter 1|●|●|●|●|●|●|●|●|●| | |●|●
105 |Parameter 2| |●|●|●|●|●|●|●|●| | |●|●
106 |Parameter 3|●|●|●|●|●|●|●|●|●|●|●|●|●
Leo Wei 1.1 107
108 **Features**
109
110 Batch transfer the BIN 16-bit data of point (N) starting from the device specified in (S) to the device specified in (D).
111
Leo Wei 26.1 112
Leo Wei 1.1 113 [[image:07-1 Basic instructions_html_be0796979ffd3c06.png||height="268" width="750"]]
114
115 When the device number exceeds the range, it will be transferred within the allowable range.
116
Joey 2.1 117 By controlling the direction reversal flag (SM224) of the BMOV instruction, the BIN 16-bit data at point (N) starting from the device specified in (D) can be batch transferred to the device specified in (S).
Leo Wei 1.1 118
119 **Error code**
120
Leo Wei 26.1 121 |Error code|Content
122 |4084H|In application instruction (N) input the data exceeds the specified range
123 |4085H|The output results of (S) and (N) in read application instruction exceed the device range
124 |4086H|The output result of (D) in write application instruction exceeds the device range
Leo Wei 1.1 125
126 **Example**
127
Leo Wei 26.1 128
Leo Wei 1.1 129 [[image:07-1 Basic instructions_html_508e98856ee24b54.png]]
130
131 When M0 is set, set M1, then (D5)→(D10); (D6)→(D11); (D7)→(D12);
132
133 When M0 is reset, set M1, then (D10)→(D5); (D11)→(D6); (D12)→(D7).
134
Leo Wei 26.1 135 == FMOV/16-bit multicast ==
Leo Wei 1.1 136
137 **FMOV(P)**
138
Joey 6.1 139 Transfer the BIN 16-bit data of the device specified in (S1) to the device specified in (D) at (N) points (that is, transfer the same data to multiple addresses).
Leo Wei 1.1 140
141 -[FMOV (S) (D) (N)]
142
143 **Content, range and data type**
144
Leo Wei 26.1 145 |Parameter|Content|Range|Data type|Data type (label)
146 |(S)|The start device that stores the transmission data|-32768 to 32767|Signed BIN16|ANY16_S
147 |(D)|The start device that transmit target|-|Signed BIN16|ANY16_S
148 |(N)|Number of transmission|[K1 ≤ N ≤ 512]|Signed BIN16|ANY16_S
Leo Wei 1.1 149
150 **Device used**
151
Leo Wei 26.1 152 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="11" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Leo Wei 1.1 153 **Pulse extension**
154 )))
Leo Wei 26.1 155 |KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|[D]|XXP
156 |(% rowspan="3" style="text-align:center; vertical-align:middle" %)FMOV|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●|●
157 |Parameter 2| |●|●|●|●|●|●|●|●| | |●|●
158 |Parameter 3|●|●|●|●|●|●|●|●|●|●|●|●|●
Leo Wei 1.1 159
160 **Features**
161
162 The same data as the BIN 16-bit data of the device specified in (S) is transferred to the device specified in (D) at (N) points.
163
Leo Wei 26.1 164
Leo Wei 1.1 165 [[image:07-1 Basic instructions_html_9ef78d87c9eeaa63.png||height="305" width="750"]]
166
167 When the number specified in (N) exceeds the device number range, transfer is performed within the allowable range.
168
169 When a constant (K) is specified for the transmission source (S), it will be automatically converted to BIN.
170
171 **Error code**
172
Leo Wei 26.1 173 |Error code|Content
174 |4084H|(S) and(N) input the data In application instruction exceed the specified range
175 |4085H|The output results of (S) and (N) in read application instruction exceed the device range
176 |4086H|The output result of (D) in write application instruction exceeds the device range
Leo Wei 1.1 177
178 **Example**
179
Leo Wei 26.1 180
Leo Wei 1.1 181 [[image:07-1 Basic instructions_html_ff5ab9afced99509.png]]
182
183 When M0 is set, the value of D0 to D4 is set to 0.
184
Leo Wei 26.1 185
Leo Wei 1.1 186 [[image:07-1 Basic instructions_html_95f9fe70e9adcf29.png||height="312" width="725"]]
187
Leo Wei 26.1 188 == DFMOV/ 32-bit multicast ==
Leo Wei 1.1 189
190 **DFMOV(P)**
191
192 Transfer the BIN 32-bit data of the device specified in (S1) to the device specified in (D) at (N) points (that is, transfer the same data to multiple addresses).
193
194 -[FMOV (S) (D) (N)]
195
196 **Content, range and data type**
197
Leo Wei 26.1 198 |Parameter|Content|Range|Data type|Data type (label)
199 |(S)|Transfer data or start device storing transfer data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
200 |(D)|Start device of transfer destination|-|Signed BIN32|ANY32_S
201 |(N)|Number of transfers|[1≤ N ≤512]|Signed BIN32|ANY32_S
Leo Wei 1.1 202
203 **Device used**
204
Leo Wei 26.1 205 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="13" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Leo Wei 1.1 206 **Pulse extension**
207 )))
Leo Wei 26.1 208 |KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|[D]|XXP
209 |(% rowspan="3" style="text-align:center; vertical-align:middle" %)DFMOV|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
210 |Parameter 2| |●|●|●|●|●|●|●|●| | | | |●|●
211 |Parameter 3|●|●|●|●|●|●|●|●|●| | |●|●|●|●
Leo Wei 1.1 212
213 **Features**
214
215 The same data as the BIN 32-bit data of the device specified in (S) is transferred to the device specified in (D) at (N) points.
216
Leo Wei 26.1 217
Leo Wei 1.1 218 [[image:07-1 Basic instructions_html_f3f9cd2e9dfe1cfe.png||height="213" width="750"]]
219
220 When the number specified in (N) exceeds the device number range, transfer is performed within the allowable range.
221
222 When a constant (K) is specified for the transmission source (S), it will be automatically converted to BIN.
223
224 **Error code**
225
Leo Wei 26.1 226 |Error code|Content
227 |4084H|(S) and (N) input the data In application instruction exceed the specified range
228 |4085H|The output results of (S) and (N) in read application instruction exceed the device range
229 |4086H|The output result of (D) in write application instruction exceeds the device range
Leo Wei 1.1 230
231 **Example**
232
Leo Wei 26.1 233
Leo Wei 1.1 234 [[image:07-1 Basic instructions_html_a390e21753dc736e.png]]
235
236 When M0 is set, the value of (D1, D0), (D3, D2), (D5, D4), (D7, D6), (D9, D8) is set to 0.
237
Leo Wei 26.1 238 == SMOV/Bit shift ==
Leo Wei 1.1 239
240 **SMOV(P)**
241
242 A instruction for distributing and synthesizing data in units of digits (4 bits).
243
244 -[SMOV (S) (N1) (N2) (D) (N3)]
245
246 **Content, range and data type**
247
Leo Wei 26.1 248 |Parameter|Content|Range|Data type|Data type (label)
249 |(S)|The word device number that stores the data whose bit is to be moved| |Signed BIN16|ANY16_S
250 |(N1)|Transfer destination device number|1 to 4|Signed BIN16|ANY16_S
251 |(N2)|The number of digits to move|1 to 4|Signed BIN16|ANY16_S
252 |(D)|The word device number that stores data for bit shifting| |Signed BIN16|ANY16_S
253 |(N3)|The starting position of the moving target|1 to 4|Signed BIN16|ANY16_S
Leo Wei 1.1 254
255 **Device used**
256
Leo Wei 26.1 257 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="11" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Leo Wei 1.1 258 **Pulse extension**
259 )))
Leo Wei 26.1 260 |KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|[D]|XXP
261 |(% rowspan="5" style="text-align:center; vertical-align:middle" %)SMOV|Parameter 1|●|●|●|●|●|●|●|●|●| | |●|●
262 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●|●
263 |Parameter 3|●|●|●|●|●|●|●|●|●|●|●|●|●
264 |Parameter 4| |●|●|●|●|●|●|●|●| | |●|●
265 |Parameter 5|●|●|●|●|●|●|●|●|●|●|●|●|●
Leo Wei 1.1 266
267 **Features**
268
269 The data is distributed/combined in units of digits (4 bits). The contents of the transmission source (S) and the transmission destination (D) are converted into 4-digit BCD (0000 to 9999), and the (N1) bits are transferred to the lower (N2) bits and the (N3) bits of the transmission destination (D) (combined ) After reaching the starting position, it is converted to BIN and stored in the transfer destination (D).
270
271 When the instruction input is OFF, the transfer destination (D) does not change.
272
273 When the instruction input is ON, the data of the transmission source (S) and the number of digits other than the transmission specification of the transmission destination (D) do not change.
274
275 Perform BIN→BCD conversion on (S).
276
277 (((
278 Transfer (synthesize) the (N1)th bit to the lower (N2), (D), (N3)th bit to the (N2)th bit counted from the previous. (D), the first and fourth digits start from (S), and the transmission will not be affected.
279
280 Convert the synthesized data (BCD) into BIN and store it in (D).
281
Leo Wei 26.1 282
Leo Wei 1.1 283 [[image:07-1 Basic instructions_html_34ee545d4d67eedb.gif||height="442" width="750"]]
284 )))
285
286 **Extended function**
287
288 If the SMOV instruction is executed after SM168 is turned ON, the BIN→BCD conversion will not be performed. The bit shift is performed in 4-bit units.
289
290 **Error code**
291
Leo Wei 26.1 292 |Error code|Content
293 |4084H|(N1), (N2) and (N3) input data that exceed the specified range in the application instruction or does not satisfy the relationship of N2≤N1 and N2≤N3.
294 |4085H|The output result of (S), (N1) (N2), (D) and (N3) in the read application instruction exceeds the device range
295 |4086H|The output result of (D) in write application instructions exceeds the device range
Leo Wei 1.1 296
297 **Example**
298
299 After synthesizing the data of the 3-digit digital switch, it is stored in D2 in binary.
300
Leo Wei 26.1 301
Leo Wei 1.1 302 [[image:07-1 Basic instructions_html_813e30f89d5a26b3.png]]
303
304 Combine data of 3 digital switches connected to non-continuous input terminals.
305
Leo Wei 26.1 306
Leo Wei 1.1 307 [[image:07-1 Basic instructions_html_313402f5a5ed68ac.png]]
308
309 When M0 is set,
310
311 (X020 to X027) BCD 2 digits → D 2 (binary);
312
313 (X000 to X003) BCD 1 digit → D 1 (binary);
314
315 Store the 1 digit of D1 into the 3 digit of D2, and synthesize a 3-digit value.
316
Leo Wei 26.1 317 == CML/16-bit invert transmission ==
Leo Wei 1.1 318
319 **CML(P)  **
320
321 After the BIN 16-bit data specified in (S) is inverted bit by bit, the result is transferred to the device specified in (D).
322
323 -[CML (S) (D)]
324
325 **Content, range and data type**
326
Leo Wei 26.1 327 |Parameter|Content|Range|Data type|Data type (label)
328 |(S)|Inverted data or the device number that stores data|-32768 to 32767|Signed BIN16|ANY16_S
329 |(D)|The device number that stores the inversion result|-|Signed BIN16|ANY16_S
Leo Wei 1.1 330
331 **Device used**
332
Leo Wei 26.1 333 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="11" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Leo Wei 1.1 334 **Pulse extension**
335 )))
Leo Wei 26.1 336 |KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|[D]|XXP
337 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)CML|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●|●
338 |Parameter 2| |●|●|●|●|●|●|●|●| | |●|●
Leo Wei 1.1 339
340 **Features**
341
342 After inverting the BIN 16-bit data specified in (S) bit by bit, the result is transferred to the device specified in (D).
343
Leo Wei 26.1 344
Leo Wei 1.1 345 [[image:07-1 Basic instructions_html_ac6a8a5d1cd98a7.png]]
346
347 When the number of digits of the device with the specified digit is 4 points, other digits are not affected.
348
349 **Error code**
350
Leo Wei 26.1 351 |Error code|Content
352 |4085H|The output result of (S) in read application instruction exceeds the device range
353 |4086H|The output result of (D) in write application instruction exceeds the device range
Leo Wei 1.1 354
355 **Example**
356
357 Example 1:
358
Leo Wei 26.1 359
Leo Wei 1.1 360 [[image:07-1 Basic instructions_html_1747c114427d7d5a.png]]
361
362 When M0 is set, the value of D0 is inverted and transferred to the value of D2.
363
364 Example 2:
365
366 invert input acquisition:
367
Leo Wei 26.1 368
Leo Wei 1.1 369 [[image:07-1 Basic instructions_html_11af96bca5fab94f.png||height="211" width="750"]]
370
Leo Wei 26.1 371 == DCML/32-bit invert transmission ==
Leo Wei 1.1 372
373 **DCML(P)**
374
375 After the BIN 32-bit data specified in (s) is inverted bit by bit, the result is transferred to the device specified in (d).
376
377 -[CML (s) (d)]
378
379 **Content, range and data type**
380
Leo Wei 26.1 381 |Parameter|Content|Range|Data type|Data type (label)
382 |(s)|Inverted data or the device number that stores data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
383 |(d)|The device number that stores the inversion result|-|Signed BIN32|ANY32_S
Leo Wei 1.1 384
385 **Device used**
386
Leo Wei 26.1 387 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="14" %)**Devices**|Offset modification|(((
Joey 7.1 388 **Pulse extension**
Leo Wei 1.1 389 )))
Leo Wei 26.1 390 |KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|E|[D]|XXP
Leo Wei 1.1 391 |(% rowspan="2" %)DCML|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
392 |Parameter 2| |●|●|●|●|●|●|●|●|●|●| | | |●|●
393
394 **Features**
395
396 After inverting the BIN 32-bit data specified in (s) bit by bit, the result is transferred to the device specified in (d).
397
Leo Wei 26.1 398
Leo Wei 1.1 399 [[image:07-1 Basic instructions_html_7f6b1b324c7b408b.png]]
400
401 When the number of digits of the device with the specified digit is 4 points, other digits are not affected.
402
403 **Error code**
404
Leo Wei 26.1 405 |Error code|Content
406 |4085H|The output result of (s) in read application instruction exceeds the device range
407 |4086H|The output result of (d) in write application instruction exceeds the device range
Leo Wei 1.1 408
409 **Example**
410
Leo Wei 26.1 411
Leo Wei 1.1 412 [[image:07-1 Basic instructions_html_10734f3934cb4211.png]]
413
414 When M0 is set, the value of (D1, D0) is reversed and transferred to the value of (D3, D2).
415
Leo Wei 26.1 416 == CMP/16-bit data comparison output ==
Leo Wei 1.1 417
418 **CMP(P)**
419
420 Compare the BIN 16-bit data of the device specified in (s1) and (s2).
421
422 -[CML (S1) (S2) (D)]
423
424 **Content, range and data type**
425
Leo Wei 26.1 426 |Parameter|Content|Range|Data type|Data type (label)
427 |(S1)|Comparison value data or the device storing the comparison value data|-32768 to +32767|Signed BIN16|ANY16_S
428 |(S2)|Comparison source data or the device storing the comparison source data|-32768 to 32767|Signed BIN16|ANY16_S
429 |(D)|Start bit device for output comparison result| |Bit|ANYBIT_ARRAY
Leo Wei 1.1 430
431 **Device used**
432
Mora Zhou 32.1 433 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="16" style="text-align:center; vertical-align:middle" %)**Devices**|**Offset modification**|(((
Leo Wei 1.1 434 **Pulse extension**
435 )))
Leo Wei 26.1 436 |Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|[D]|XXP
437 |(% rowspan="3" style="text-align:center; vertical-align:middle" %)CMP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●
438 |Parameter 2| | | | | | |●|●|●|●|●|●|●|●| | |●|●
439 |Parameter 3|●|●|●|●|●| | | | | | | | | | | |●|
Leo Wei 1.1 440
441 **Features**
442
443 Compare the BIN 16-bit data of the device specified in (S1) with the BIN 16-bit data of the device specified in (S2). According to the result (less than, consistent, greater than), (D), (D)+1, (D) One of )+2 will turn ON.
444
445 (S1) and (S2) are handled as BIN values within the above setting data range.
446
447 Use algebraic methods for size comparison.
448
Leo Wei 26.1 449
Leo Wei 1.1 450 [[image:07-1 Basic instructions_html_d5b466b2989a168c.png||height="295" width="750"]]
451
452 (1): Even if the instruction input is OFF and the CMP instruction is not executed, (D) to (D)+2 will keep the state before the instruction input changed from ON to OFF.
453
Mora Zhou 32.1 454 (% class="box infomessage" %)
455 (((
Leo Wei 1.1 456 ✎**Note:  **Occupy the device specified in 3 points (D) at the beginning, please be careful not to overlap with the device used for other control.
Mora Zhou 32.1 457 )))
Leo Wei 1.1 458
459 **Error code**
460
Leo Wei 26.1 461 |Error code|Content
462 |4085H|The output results of (S1) and (S2) in read application instruction exceed the device range
463 |4086H|The output result of (D) in write application instruction exceeds the device range
Leo Wei 1.1 464
465 **Example**
466
Leo Wei 26.1 467
Leo Wei 1.1 468 [[image:07-1 Basic instructions_html_3f1803378f8b10a8.png]]
469
470 When M0 is set, compare the values of D0 and D2:
471
472 If (D0)> (D2) then Y0 is ON.
473
474 If (D0) = (D2) then Y1 is ON. If (D0) <(D2) then Y2 is ON.
475
Leo Wei 26.1 476 == DCMP/32-bit data comparison output ==
Leo Wei 1.1 477
478 **DCMP(P)**
479
480 Compare the BIN 32-bit data of the device specified in (S1) and (S2).
481
482 -[DCML (S1) (S2) (D)]
483
484 **Content, range and data type**
485
Leo Wei 26.1 486 |Parameter|Content|Range|Data type|Data type (label)
487 |(S1)|Comparison value data or the device storing the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
488 |(S2)|Comparison source data or the device storing the comparison source data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
489 |(D)|Start bit device for output comparison result| |Bit|ANYBIT_ARRAY
Leo Wei 1.1 490
491 **Device used**
492
Leo Wei 26.1 493 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="18" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Leo Wei 1.1 494 **Pulse extension**
495 )))
Leo Wei 26.1 496 |Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|[D]|XXP
497 |(% rowspan="3" style="text-align:center; vertical-align:middle" %)DCMP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
498 |Parameter 2| | | | | | |●|●|●|●|●|●|●|●|●|●| | |●|●
499 |Parameter 3|●|●|●|●|●| | | | | | | | | | | | | |●|
Leo Wei 1.1 500
501 **Features**
502
503 • Compare the BIN 16-bit data of the device specified in (S1) with the BIN 16-bit data of the device specified in (S2). According to the result (less than, consistent, greater than), (D), (D)+1, (D) One of )+2 will turn ON.
504
505 • (S1) and (S2) are handled as BIN values within the above setting data range.
506
507 • Use algebraic methods for size comparison.
508
Leo Wei 26.1 509
Leo Wei 1.1 510 [[image:07-1 Basic instructions_html_d5b466b2989a168c.png||height="295" width="750"]]
511
512 (1): Even if the instruction input is OFF, the DCMP instruction is not executed, (D) to (D)+2 will keep the state before the instruction input changed from ON to OFF.
513
514 ✎**Note: ** Occupy the device specified in 3 points (D) at the beginning. Please be careful not to overlap with other control devices.
515
516 **Error code**
517
Leo Wei 26.1 518 |Error code|Content
519 |4085H|The output results of (S1) and (S2) in read application instruction exceed the device range
520 |4086H|The output result of (D) in write application instruction exceeds the device range
Leo Wei 1.1 521
522 **Example**
523
Leo Wei 26.1 524
Leo Wei 1.1 525 [[image:07-1 Basic instructions_html_db9a9675057311a.png]]
526
527 When M0 is set, compare the values of (D1, D0) and (D3, D2):
528
529 If (D1, D0)> (D3, D2) then Y0 is ON.
530
531 If (D1, D0) = (D3, D2) then Y1 is ON.
532
533 If (D1, D0) <(D3, D2) then Y2 is ON.
534
Leo Wei 26.1 535 == XCH/16-bit data exchange ==
Leo Wei 1.1 536
537 **XCH(P)**
538
539 Exchange the BIN 16-bit data of (D1) and (D2).
540
541 -[XCH (D1) (D2)]
542
543 **Content, range and data type**
544
Leo Wei 26.1 545 |Parameter|Content|Range|Data type|Data type (label)
546 |(D1)|The start device that stores the exchange data|-32768 to 32767|Signed BIN16|ANY16_S
547 |(D2)|The start device that stores the exchange data|-32768 to 32767|Signed BIN16|ANY16_S
Leo Wei 1.1 548
549 **Device used**
550
Leo Wei 26.1 551 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="8" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Leo Wei 1.1 552 **Pulse extension**
553 )))
Leo Wei 26.1 554 |KnY|KnM|KnS|T|C|D|R|SD|[D]|XXP
555 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)XCH|Parameter 1|●|●|●|●|●|●|●|●|●|●
556 |Parameter 2|●|●|●|●|●|●|●|●|●|●
Leo Wei 1.1 557
558 **Features**
559
560 • Exchange the BIN 16-bit data of (D1) and (D2).
561
Leo Wei 26.1 562
Leo Wei 1.1 563 [[image:07-1 Basic instructions_html_da762df21d9f9e95.png||height="276" width="713"]]
564
565 • When executing instructions with SM160 ON, if the device numbers of (D1) and (D2) are the same. Exchange the upper 8 bits (byte) and lower 8 bits (byte) of the word device.
566
Leo Wei 26.1 567
Leo Wei 1.1 568 [[image:07-1 Basic instructions_html_c0cea7cfb5b2e83c.png]]
569
570 ✎**Note: **If continuous execution instructions are used, conversion will be performed every operation cycle.
571
572 **Error code**
573
Leo Wei 26.1 574 |Error code|Content
575 |4084H|In exchange mode, the devices in (D1) and (D2) are different
576 |4085H|The output results of (D1) and (D2) in the read application instruction exceed the device range
577 |4086H|The output results of (D1) and (D2) in the writing application instruction exceed the device range
Leo Wei 1.1 578
579 **Example**
580
581 When M0 is reset, set M1: the value of D0 and the value of D2 are exchanged.
582
Leo Wei 26.1 583
Leo Wei 1.1 584 [[image:07-1 Basic instructions_html_379b08fc9ff53251.png]]
585
586 When M0 is set, M1 is set: the upper 8 bits (bytes) and lower 8 bits (bytes) of D0 are exchanged with each other.
587
Leo Wei 26.1 588
Leo Wei 1.1 589 [[image:07-1 Basic instructions_html_3642e474e8c61a0f.png]]
590
Leo Wei 26.1 591 == DXCH/32-bit data exchange ==
Leo Wei 1.1 592
593 **DXCH(P)**
594
595 Exchange (D1) and (D2) BIN 32-bit data.
596
597 -[DXCH (D1) (D2)]
598
599 **Content, range and data type**
600
Leo Wei 26.1 601 |Parameter|Content|Range|Data type|Data type (label)
602 |(D1)|The start device that stores the exchange data|-2147483647 to 2147483647|Signed BIN32|ANY32_S
603 |(D2)|The start device that stores the exchange data|-2147483647 to 2147483647|Signed BIN32|ANY32_S
Leo Wei 1.1 604
605 **Device used**
606
Leo Wei 26.1 607 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="10" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Leo Wei 1.1 608 **Pulse extension**
609 )))
Leo Wei 26.1 610 |KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|[D]|XXP
611 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)DXCH|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●
612 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●
Leo Wei 1.1 613
614 **Features**
615
616 • Exchange the BIN 32-bit data of (D1), (D1)+1 and (D2), (D2)+1.
617
Leo Wei 26.1 618
Leo Wei 1.1 619 [[image:07-1 Basic instructions_html_3e35d534c210d03a.png||height="288" width="750"]]
620
621 • When executing instructions with SM160 ON, if the device numbers of (D1) and (D2) are the same. Exchange the upper 8 bits (byte) and lower 8 bits (byte) of the word device (D1) and (D1+1).
622
Leo Wei 26.1 623
Leo Wei 1.1 624 [[image:07-1 Basic instructions_html_f115854aba0c26e.png||height="222" width="880"]]
625
626 ✎**Note: **If continuous execution instructions are used, conversion will be performed every operation cycle.
627
628 **Error code**
629
Leo Wei 26.1 630 |Error code|Content
631 |4084H|In exchange mode, the devices in (D1) and (D2) are different
632 |4085H|The output results of (D1) and (D2) in the read application instruction exceed the device range
633 |4086H|The output results of (D1) and (D2) in the writing application instruction exceed the device range
Leo Wei 1.1 634
635 **Example :**
636
637 When M0 is set, M1 is set: the high 8 bits (byte) and low 8 bits (byte) of the D0 Devices are exchanged, and the high 8 bits (byte) and low 8 bits (byte) of the D1 Devices ) Exchange each other.
638
Leo Wei 26.1 639
Leo Wei 1.1 640 [[image:07-1 Basic instructions_html_4e345d7e7c986d10.png]]
641
642 When M0 is reset, set M1: the value of (D1, D0) and the value of (D3, D2) are exchanged.
643
Leo Wei 26.1 644
Leo Wei 1.1 645 [[image:07-1 Basic instructions_html_9fff2f30b51cfc7f.png]]
646
Leo Wei 26.1 647 == ZCP/16-bit data interval comparison ==
Leo Wei 1.1 648
649 **ZCP(P)**
650
651 Compare the BIN 16-bit data of the device specified in (S1) and the value (bandwidth) of the BIN 16-bit data of the device specified in (S2) with the BIN 16-bit data of the device specified in the comparison source (S3), Output the result (bottom, area, top) to the device specified in (D) and later.
652
653 -[ZCP (S1) (S2) (S3) (D)]
654
655 **Content, range and data type**
656
Leo Wei 26.1 657 |Parameter|Content|Range|Data type|Data type (label)
658 |(S1)|The comparison value data of low limit or the device that stores the comparison value data|-32768 to 32767|Signed BIN16|ANY16_S
659 |(S2)|The comparison value data of high limit or the device that stores the comparison value data|-32768 to 32767|Signed BIN16|ANY16_S
660 |(S3)|Comparison source data or the device that stores the comparison source data|-32768 to 32767|Signed BIN16|ANY16_S
661 |(D)|The start bit device of output comparison result| |Bit|ANYBIT_ARRAY
Leo Wei 1.1 662
663 **Device used**
664
Leo Wei 26.1 665 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Instruction**|(% rowspan="2" style="text-align:center; vertical-align:middle" %)**Parameter**|(% colspan="17" style="text-align:center; vertical-align:middle" %)**Devices**|Offset modification|(((
Leo Wei 1.1 666 **Pulse extension**
667 )))
Leo Wei 26.1 668 |Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|E|[D]|XXP
669 |(% rowspan="4" style="text-align:center; vertical-align:middle" %)ZCP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
670 |Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
671 |Parameter 3| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
672 |Parameter 4|●|●|●|●|●| | | | | | | | | | | | |●|
Leo Wei 1.1 673
674 **Features**
675
676 • Compare the BIN 16-bit data of the device specified in (S1) and the value (bandwidth) of the BIN 16-bit data of the device specified in (S2) with the BIN 16-bit data of the device specified in the comparison source (S3) , According to the result (bottom, area, top), one of (D), (D)+1, (D)+2 will be turned ON. (S1), (S2), (S3) are treated as BIN values within the above-mentioned setting data range. Use algebraic methods for size comparison.
677
678 • Use algebraic methods for size comparison.
679
Leo Wei 26.1 680
Leo Wei 1.1 681 [[image:07-1 Basic instructions_html_878004f8efa838b.gif||height="361" width="700"]]
682
683 (1): Even if the instruction input is OFF and the ZCP instruction is not executed, (D) to (D)+2 will keep the state before the instruction input turns from ON to OFF.
684
685 ✎**Note: **
686
687 • Please set the lower comparison value (S1) to a value smaller than the upper comparison value (S2).
688
689 • When (s1) is greater than (S2), it will be processed as (S2)=(S1).
690
691 • The device specified in 3 points (d) is occupied at the beginning. Please be careful not to overlap with other control devices.
692
693 **Error code**
694
Leo Wei 26.1 695 |Error code|Content
696 |4085H|The output results of (S1), (S2) and (S3) in the read application instruction exceed the device range
697 |4086H|The output result of (D) in write application instructions exceeds the device range
Leo Wei 1.1 698
699 **Example**
700
Leo Wei 26.1 701
Leo Wei 1.1 702 [[image:07-1 Basic instructions_html_db2bc281a152807e.png]]
703
704 When M0 is set, compare whether D0 is between 0 and 1000:
705
706 If (D0)> (1000), then Y0 is ON.
707
708 If (0) ≤ (D0) ≤ (1000), then Y1 is ON.
709
710 If (D0) <(0), then Y2 is ON.
711
Leo Wei 26.1 712 == DZCP/32-bit data interval comparison ==
Leo Wei 1.1 713
714 **DZCP(P)**
715
716 Compare the BIN 32-bit data of the device specified in (S1) and the value (bandwidth) of the BIN 32-bit data of the device specified in (S2) with the BIN 32-bit data of the device specified in the comparison source (S3), Output the result (bottom, area, top) to the device specified in (D) and later.
717
718 -[DZCP (S1) (S2) (S3) (D)]
719
720 **Content, range and data type**
721
Leo Wei 26.1 722 |Parameter|Content|Range|Data type|Data type (label)
723 |(S1)|The comparison value data of low limit or the device that stores the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
724 |(S2)|The comparison value data of high limit or the device that stores the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
725 |(S3)|Comparison source data or the device that stores the comparison source data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
726 |(D)|The start bit device of output comparison result| |Bit|ANYBIT_ARRAY
Leo Wei 1.1 727
728 **Device used**
729
Leo Wei 26.1 730 |=(% rowspan="2" scope="row" %)Instruction|=(% rowspan="2" %)Parameter|=(% colspan="19" %)Devices|=Offset modification|=(((
731 Pulse extension
Leo Wei 1.1 732 )))
Leo Wei 26.1 733 |=Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|E|[D]|XXP
734 |=(% rowspan="4" %)DZCP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
735 |=Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
736 |=Parameter 3| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
737 |=Parameter 4|●|●|●|●|●| | | | | | | | | | | | | | |●|
Leo Wei 1.1 738
739 **Features**
740
741 • Compare the BIN 32-bit data of the device specified in (S1) and the value (bandwidth) of the BIN 32-bit data of the device specified in (S2) with the BIN 32-bit data of the device specified in the comparison source (S3) , According to the result (bottom, area, top), one of (D), (D)+1, (D)+2 will be turned ON. (S1), (S2), (S3) are treated as BIN values within the above-mentioned setting data range. Use algebraic methods for size comparison.
742
743 • Use algebraic methods for size comparison.
744
Leo Wei 26.1 745
Leo Wei 1.1 746 [[image:07-1 Basic instructions_html_878004f8efa838b.gif||height="361" width="700"]]
747
748 (1): Even if the instruction input is OFF and the ZCP instruction is not executed, (D) to (D)+2 will keep the state before the instruction input turns from ON to OFF.
749
750 ✎**Note: **
751
752 • Please set the lower comparison value (S1) to a value smaller than the upper comparison value (S2).
753
754 • When (S1) is greater than (S2), it will be processed as (S2)=(S1).
755
756 • The device specified in 3 points (D) is occupied at the beginning. Please be careful not to overlap with other control devices.
757
758 **Error code**
759
Leo Wei 26.1 760 |Error code|Content
761 |4085H|The output results of (S1), (S2) and (S3) in the read application instruction exceed the device range
762 |4086H|The output results of (D) in the write application instruction exceeds the device range
Leo Wei 1.1 763
764 **Example**
765
Leo Wei 26.1 766
Leo Wei 1.1 767 [[image:07-1 Basic instructions_html_a215dc073ae34e2c.png]]
768
769 When M0 is set, compare D0 with whether it is between 0 and 100000:
770
771 If (D0)> (100000), then Y0 is ON.
772
773 If (0) ≤ (D0) ≤ (100000), then Y1 is ON.
774
775 If (D0) <(0), then Y2 is ON.