Wiki source code of 01 Transfer and comparison

Version 33.1 by Mora Zhou on 2023/11/22 16:07

Show last authors
1 == MOV/16-bit transmission ==
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
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
14
15 **Device used**
16
17 |=(% rowspan="2" scope="row" %)Instruction|=(% rowspan="2" %)Parameter|=(% colspan="11" %)Devices|=Offset modification|=Pulse extension
18 |KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|[D]|XXP
19 |=(% rowspan="2" %)MOV|=Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●|●
20 |=Parameter 2| |●|●|●|●|●|●|●|●| | |●|●
21
22 **Features**
23
24 • Transfer the BIN 16-bit data specified in (S) to the device specified in (D).
25
26
27 [[image:07-1 Basic instructions_html_608d557cd7a9b085.png||height="178" width="700"]]
28
29 **Error code**
30
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
34
35 **Example**
36
37
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
42 == DMOV/32-bit transmission ==
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
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
55
56 **Device used**
57
58 |=(% rowspan="2" scope="row" %)Instruction|=(% rowspan="2" %)Parameter|=(% colspan="13" %)Devices|=Offset modification|=Pulse extension
59 |KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|[D]|XXP
60 |=(% rowspan="2" %)DMOV|=Parameter 1|●|●|●|●|●|●|●|●|●| | |●|●|●|●
61 |=Parameter 2| |●|●|●|●|●|●|●|●|●|●| | |●|●
62
63 **Features**
64
65 Transfer the BIN 16-bit data specified in (S) to the device specified in (D).
66
67
68 [[image:07-1 Basic instructions_html_a7a87e4ee0331a3.png||height="248" width="725"]]
69
70 **Error code**
71
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
75
76 **Example**
77
78
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
83 == BMOV/Batch transmission ==
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
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
97
98 **Device used**
99
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|(((
101 **Pulse extension**
102 )))
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|●|●|●|●|●|●|●|●|●|●|●|●|●
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
112
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
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).
118
119 **Error code**
120
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
125
126 **Example**
127
128
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
135 == FMOV/16-bit multicast ==
136
137 **FMOV(P)**
138
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).
140
141 -[FMOV (S) (D) (N)]
142
143 **Content, range and data type**
144
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
149
150 **Device used**
151
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|(((
153 **Pulse extension**
154 )))
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|●|●|●|●|●|●|●|●|●|●|●|●|●
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
164
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
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
177
178 **Example**
179
180
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
185
186 [[image:07-1 Basic instructions_html_95f9fe70e9adcf29.png||height="312" width="725"]]
187
188 == DFMOV/ 32-bit multicast ==
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
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
202
203 **Device used**
204
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|(((
206 **Pulse extension**
207 )))
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|●|●|●|●|●|●|●|●|●| | |●|●|●|●
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
217
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
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
230
231 **Example**
232
233
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
238 == SMOV/Bit shift ==
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
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
254
255 **Device used**
256
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|(((
258 **Pulse extension**
259 )))
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|●|●|●|●|●|●|●|●|●|●|●|●|●
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
282
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
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
296
297 **Example**
298
299 After synthesizing the data of the 3-digit digital switch, it is stored in D2 in binary.
300
301
302 [[image:07-1 Basic instructions_html_813e30f89d5a26b3.png]]
303
304 Combine data of 3 digital switches connected to non-continuous input terminals.
305
306
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
317 == CML/16-bit invert transmission ==
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
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
330
331 **Device used**
332
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|(((
334 **Pulse extension**
335 )))
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| |●|●|●|●|●|●|●|●| | |●|●
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
344
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
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
354
355 **Example**
356
357 Example 1:
358
359
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
368
369 [[image:07-1 Basic instructions_html_11af96bca5fab94f.png||height="211" width="750"]]
370
371 == DCML/32-bit invert transmission ==
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
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
384
385 **Device used**
386
387 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="14" %)**Devices**|Offset modification|(((
388 **Pulse extension**
389 )))
390 |KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|E|[D]|XXP
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
398
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
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
408
409 **Example**
410
411
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
416 == CMP/16-bit data comparison output ==
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
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
430
431 **Device used**
432
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**|(((
434 **Pulse extension**
435 )))
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|●|●|●|●|●| | | | | | | | | | | |●|
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
449
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
454 (% class="box infomessage" %)
455 (((
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.
457 )))
458
459 **Error code**
460
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
464
465 **Example**
466
467
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
476 == DCMP/32-bit data comparison output ==
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
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
490
491 **Device used**
492
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|(((
494 **Pulse extension**
495 )))
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|●|●|●|●|●| | | | | | | | | | | | | |●|
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
509
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 (% class="box infomessage" %)
515 (((
516 ✎**Note: ** Occupy the device specified in 3 points (D) at the beginning. Please be careful not to overlap with other control devices.
517 )))
518
519 **Error code**
520
521 |Error code|Content
522 |4085H|The output results of (S1) and (S2) in read application instruction exceed the device range
523 |4086H|The output result of (D) in write application instruction exceeds the device range
524
525 **Example**
526
527
528 [[image:07-1 Basic instructions_html_db9a9675057311a.png]]
529
530 When M0 is set, compare the values of (D1, D0) and (D3, D2):
531
532 If (D1, D0)> (D3, D2) then Y0 is ON.
533
534 If (D1, D0) = (D3, D2) then Y1 is ON.
535
536 If (D1, D0) <(D3, D2) then Y2 is ON.
537
538 == XCH/16-bit data exchange ==
539
540 **XCH(P)**
541
542 Exchange the BIN 16-bit data of (D1) and (D2).
543
544 -[XCH (D1) (D2)]
545
546 **Content, range and data type**
547
548 |Parameter|Content|Range|Data type|Data type (label)
549 |(D1)|The start device that stores the exchange data|-32768 to 32767|Signed BIN16|ANY16_S
550 |(D2)|The start device that stores the exchange data|-32768 to 32767|Signed BIN16|ANY16_S
551
552 **Device used**
553
554 |(% 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|(((
555 **Pulse extension**
556 )))
557 |KnY|KnM|KnS|T|C|D|R|SD|[D]|XXP
558 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)XCH|Parameter 1|●|●|●|●|●|●|●|●|●|●
559 |Parameter 2|●|●|●|●|●|●|●|●|●|●
560
561 **Features**
562
563 • Exchange the BIN 16-bit data of (D1) and (D2).
564
565
566 [[image:07-1 Basic instructions_html_da762df21d9f9e95.png||height="276" width="713"]]
567
568 • 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.
569
570
571 [[image:07-1 Basic instructions_html_c0cea7cfb5b2e83c.png]]
572
573 ✎**Note: **If continuous execution instructions are used, conversion will be performed every operation cycle.
574
575 **Error code**
576
577 |Error code|Content
578 |4084H|In exchange mode, the devices in (D1) and (D2) are different
579 |4085H|The output results of (D1) and (D2) in the read application instruction exceed the device range
580 |4086H|The output results of (D1) and (D2) in the writing application instruction exceed the device range
581
582 **Example**
583
584 When M0 is reset, set M1: the value of D0 and the value of D2 are exchanged.
585
586
587 [[image:07-1 Basic instructions_html_379b08fc9ff53251.png]]
588
589 When M0 is set, M1 is set: the upper 8 bits (bytes) and lower 8 bits (bytes) of D0 are exchanged with each other.
590
591
592 [[image:07-1 Basic instructions_html_3642e474e8c61a0f.png]]
593
594 == DXCH/32-bit data exchange ==
595
596 **DXCH(P)**
597
598 Exchange (D1) and (D2) BIN 32-bit data.
599
600 -[DXCH (D1) (D2)]
601
602 **Content, range and data type**
603
604 |Parameter|Content|Range|Data type|Data type (label)
605 |(D1)|The start device that stores the exchange data|-2147483647 to 2147483647|Signed BIN32|ANY32_S
606 |(D2)|The start device that stores the exchange data|-2147483647 to 2147483647|Signed BIN32|ANY32_S
607
608 **Device used**
609
610 |(% 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|(((
611 **Pulse extension**
612 )))
613 |KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|[D]|XXP
614 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)DXCH|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●
615 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●
616
617 **Features**
618
619 • Exchange the BIN 32-bit data of (D1), (D1)+1 and (D2), (D2)+1.
620
621
622 [[image:07-1 Basic instructions_html_3e35d534c210d03a.png||height="288" width="750"]]
623
624 • 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).
625
626
627 [[image:07-1 Basic instructions_html_f115854aba0c26e.png||height="222" width="880"]]
628
629 ✎**Note: **If continuous execution instructions are used, conversion will be performed every operation cycle.
630
631 **Error code**
632
633 |Error code|Content
634 |4084H|In exchange mode, the devices in (D1) and (D2) are different
635 |4085H|The output results of (D1) and (D2) in the read application instruction exceed the device range
636 |4086H|The output results of (D1) and (D2) in the writing application instruction exceed the device range
637
638 **Example :**
639
640 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.
641
642
643 [[image:07-1 Basic instructions_html_4e345d7e7c986d10.png]]
644
645 When M0 is reset, set M1: the value of (D1, D0) and the value of (D3, D2) are exchanged.
646
647
648 [[image:07-1 Basic instructions_html_9fff2f30b51cfc7f.png]]
649
650 == ZCP/16-bit data interval comparison ==
651
652 **ZCP(P)**
653
654 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.
655
656 -[ZCP (S1) (S2) (S3) (D)]
657
658 **Content, range and data type**
659
660 |Parameter|Content|Range|Data type|Data type (label)
661 |(S1)|The comparison value data of low limit or the device that stores the comparison value data|-32768 to 32767|Signed BIN16|ANY16_S
662 |(S2)|The comparison value data of high limit or the device that stores the comparison value data|-32768 to 32767|Signed BIN16|ANY16_S
663 |(S3)|Comparison source data or the device that stores the comparison source data|-32768 to 32767|Signed BIN16|ANY16_S
664 |(D)|The start bit device of output comparison result| |Bit|ANYBIT_ARRAY
665
666 **Device used**
667
668 |(% 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|(((
669 **Pulse extension**
670 )))
671 |Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|E|[D]|XXP
672 |(% rowspan="4" style="text-align:center; vertical-align:middle" %)ZCP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
673 |Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
674 |Parameter 3| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
675 |Parameter 4|●|●|●|●|●| | | | | | | | | | | | |●|
676
677 **Features**
678
679 • 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.
680
681 • Use algebraic methods for size comparison.
682
683
684 [[image:07-1 Basic instructions_html_878004f8efa838b.gif||height="361" width="700"]]
685
686 (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.
687
688 ✎**Note: **
689
690 • Please set the lower comparison value (S1) to a value smaller than the upper comparison value (S2).
691
692 • When (s1) is greater than (S2), it will be processed as (S2)=(S1).
693
694 • The device specified in 3 points (d) is occupied at the beginning. Please be careful not to overlap with other control devices.
695
696 **Error code**
697
698 |Error code|Content
699 |4085H|The output results of (S1), (S2) and (S3) in the read application instruction exceed the device range
700 |4086H|The output result of (D) in write application instructions exceeds the device range
701
702 **Example**
703
704
705 [[image:07-1 Basic instructions_html_db2bc281a152807e.png]]
706
707 When M0 is set, compare whether D0 is between 0 and 1000:
708
709 If (D0)> (1000), then Y0 is ON.
710
711 If (0) ≤ (D0) ≤ (1000), then Y1 is ON.
712
713 If (D0) <(0), then Y2 is ON.
714
715 == DZCP/32-bit data interval comparison ==
716
717 **DZCP(P)**
718
719 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.
720
721 -[DZCP (S1) (S2) (S3) (D)]
722
723 **Content, range and data type**
724
725 |Parameter|Content|Range|Data type|Data type (label)
726 |(S1)|The comparison value data of low limit or the device that stores the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
727 |(S2)|The comparison value data of high limit or the device that stores the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
728 |(S3)|Comparison source data or the device that stores the comparison source data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
729 |(D)|The start bit device of output comparison result| |Bit|ANYBIT_ARRAY
730
731 **Device used**
732
733 |=(% rowspan="2" scope="row" %)Instruction|=(% rowspan="2" %)Parameter|=(% colspan="19" %)Devices|=Offset modification|=(((
734 Pulse extension
735 )))
736 |=Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|E|[D]|XXP
737 |=(% rowspan="4" %)DZCP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
738 |=Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
739 |=Parameter 3| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
740 |=Parameter 4|●|●|●|●|●| | | | | | | | | | | | | | |●|
741
742 **Features**
743
744 • 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.
745
746 • Use algebraic methods for size comparison.
747
748
749 [[image:07-1 Basic instructions_html_878004f8efa838b.gif||height="361" width="700"]]
750
751 (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.
752
753 ✎**Note: **
754
755 • Please set the lower comparison value (S1) to a value smaller than the upper comparison value (S2).
756
757 • When (S1) is greater than (S2), it will be processed as (S2)=(S1).
758
759 • The device specified in 3 points (D) is occupied at the beginning. Please be careful not to overlap with other control devices.
760
761 **Error code**
762
763 |Error code|Content
764 |4085H|The output results of (S1), (S2) and (S3) in the read application instruction exceed the device range
765 |4086H|The output results of (D) in the write application instruction exceeds the device range
766
767 **Example**
768
769
770 [[image:07-1 Basic instructions_html_a215dc073ae34e2c.png]]
771
772 When M0 is set, compare D0 with whether it is between 0 and 100000:
773
774 If (D0)> (100000), then Y0 is ON.
775
776 If (0) ≤ (D0) ≤ (100000), then Y1 is ON.
777
778 If (D0) <(0), then Y2 is ON.