Wiki source code of 01 Transfer and comparison

Version 26.2 by Leo Wei on 2022/07/18 16:36

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