Wiki source code of 01 Transfer and comparison

Version 30.1 by Leo Wei on 2022/07/18 16:39

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 ✎**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.
455
456 **Error code**
457
458 |Error code|Content
459 |4085H|The output results of (S1) and (S2) in read application instruction exceed the device range
460 |4086H|The output result of (D) in write application instruction exceeds the device range
461
462 **Example**
463
464
465 [[image:07-1 Basic instructions_html_3f1803378f8b10a8.png]]
466
467 When M0 is set, compare the values of D0 and D2:
468
469 If (D0)> (D2) then Y0 is ON.
470
471 If (D0) = (D2) then Y1 is ON. If (D0) <(D2) then Y2 is ON.
472
473 == DCMP/32-bit data comparison output ==
474
475 **DCMP(P)**
476
477 Compare the BIN 32-bit data of the device specified in (S1) and (S2).
478
479 -[DCML (S1) (S2) (D)]
480
481 **Content, range and data type**
482
483 |Parameter|Content|Range|Data type|Data type (label)
484 |(S1)|Comparison value data or the device storing the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
485 |(S2)|Comparison source data or the device storing the comparison source data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
486 |(D)|Start bit device for output comparison result| |Bit|ANYBIT_ARRAY
487
488 **Device used**
489
490 |(% 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|(((
491 **Pulse extension**
492 )))
493 |Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|[D]|XXP
494 |(% rowspan="3" style="text-align:center; vertical-align:middle" %)DCMP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
495 |Parameter 2| | | | | | |●|●|●|●|●|●|●|●|●|●| | |●|●
496 |Parameter 3|●|●|●|●|●| | | | | | | | | | | | | |●|
497
498 **Features**
499
500 • 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.
501
502 • (S1) and (S2) are handled as BIN values within the above setting data range.
503
504 • Use algebraic methods for size comparison.
505
506
507 [[image:07-1 Basic instructions_html_d5b466b2989a168c.png||height="295" width="750"]]
508
509 (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.
510
511 ✎**Note: ** Occupy the device specified in 3 points (D) at the beginning. Please be careful not to overlap with other control devices.
512
513 **Error code**
514
515 |Error code|Content
516 |4085H|The output results of (S1) and (S2) in read application instruction exceed the device range
517 |4086H|The output result of (D) in write application instruction exceeds the device range
518
519 **Example**
520
521
522 [[image:07-1 Basic instructions_html_db9a9675057311a.png]]
523
524 When M0 is set, compare the values of (D1, D0) and (D3, D2):
525
526 If (D1, D0)> (D3, D2) then Y0 is ON.
527
528 If (D1, D0) = (D3, D2) then Y1 is ON.
529
530 If (D1, D0) <(D3, D2) then Y2 is ON.
531
532 == XCH/16-bit data exchange ==
533
534 **XCH(P)**
535
536 Exchange the BIN 16-bit data of (D1) and (D2).
537
538 -[XCH (D1) (D2)]
539
540 **Content, range and data type**
541
542 |Parameter|Content|Range|Data type|Data type (label)
543 |(D1)|The start device that stores the exchange data|-32768 to 32767|Signed BIN16|ANY16_S
544 |(D2)|The start device that stores the exchange data|-32768 to 32767|Signed BIN16|ANY16_S
545
546 **Device used**
547
548 |(% 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|(((
549 **Pulse extension**
550 )))
551 |KnY|KnM|KnS|T|C|D|R|SD|[D]|XXP
552 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)XCH|Parameter 1|●|●|●|●|●|●|●|●|●|●
553 |Parameter 2|●|●|●|●|●|●|●|●|●|●
554
555 **Features**
556
557 • Exchange the BIN 16-bit data of (D1) and (D2).
558
559
560 [[image:07-1 Basic instructions_html_da762df21d9f9e95.png||height="276" width="713"]]
561
562 • 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.
563
564
565 [[image:07-1 Basic instructions_html_c0cea7cfb5b2e83c.png]]
566
567 ✎**Note: **If continuous execution instructions are used, conversion will be performed every operation cycle.
568
569 **Error code**
570
571 |Error code|Content
572 |4084H|In exchange mode, the devices in (D1) and (D2) are different
573 |4085H|The output results of (D1) and (D2) in the read application instruction exceed the device range
574 |4086H|The output results of (D1) and (D2) in the writing application instruction exceed the device range
575
576 **Example**
577
578 When M0 is reset, set M1: the value of D0 and the value of D2 are exchanged.
579
580
581 [[image:07-1 Basic instructions_html_379b08fc9ff53251.png]]
582
583 When M0 is set, M1 is set: the upper 8 bits (bytes) and lower 8 bits (bytes) of D0 are exchanged with each other.
584
585
586 [[image:07-1 Basic instructions_html_3642e474e8c61a0f.png]]
587
588 == DXCH/32-bit data exchange ==
589
590 **DXCH(P)**
591
592 Exchange (D1) and (D2) BIN 32-bit data.
593
594 -[DXCH (D1) (D2)]
595
596 **Content, range and data type**
597
598 |Parameter|Content|Range|Data type|Data type (label)
599 |(D1)|The start device that stores the exchange data|-2147483647 to 2147483647|Signed BIN32|ANY32_S
600 |(D2)|The start device that stores the exchange data|-2147483647 to 2147483647|Signed BIN32|ANY32_S
601
602 **Device used**
603
604 |(% 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|(((
605 **Pulse extension**
606 )))
607 |KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|[D]|XXP
608 |(% rowspan="2" style="text-align:center; vertical-align:middle" %)DXCH|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●
609 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●
610
611 **Features**
612
613 • Exchange the BIN 32-bit data of (D1), (D1)+1 and (D2), (D2)+1.
614
615
616 [[image:07-1 Basic instructions_html_3e35d534c210d03a.png||height="288" width="750"]]
617
618 • 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).
619
620
621 [[image:07-1 Basic instructions_html_f115854aba0c26e.png||height="222" width="880"]]
622
623 ✎**Note: **If continuous execution instructions are used, conversion will be performed every operation cycle.
624
625 **Error code**
626
627 |Error code|Content
628 |4084H|In exchange mode, the devices in (D1) and (D2) are different
629 |4085H|The output results of (D1) and (D2) in the read application instruction exceed the device range
630 |4086H|The output results of (D1) and (D2) in the writing application instruction exceed the device range
631
632 **Example :**
633
634 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.
635
636
637 [[image:07-1 Basic instructions_html_4e345d7e7c986d10.png]]
638
639 When M0 is reset, set M1: the value of (D1, D0) and the value of (D3, D2) are exchanged.
640
641
642 [[image:07-1 Basic instructions_html_9fff2f30b51cfc7f.png]]
643
644 == ZCP/16-bit data interval comparison ==
645
646 **ZCP(P)**
647
648 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.
649
650 -[ZCP (S1) (S2) (S3) (D)]
651
652 **Content, range and data type**
653
654 |Parameter|Content|Range|Data type|Data type (label)
655 |(S1)|The comparison value data of low limit or the device that stores the comparison value data|-32768 to 32767|Signed BIN16|ANY16_S
656 |(S2)|The comparison value data of high limit or the device that stores the comparison value data|-32768 to 32767|Signed BIN16|ANY16_S
657 |(S3)|Comparison source data or the device that stores the comparison source data|-32768 to 32767|Signed BIN16|ANY16_S
658 |(D)|The start bit device of output comparison result| |Bit|ANYBIT_ARRAY
659
660 **Device used**
661
662 |(% 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|(((
663 **Pulse extension**
664 )))
665 |Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|K|H|E|[D]|XXP
666 |(% rowspan="4" style="text-align:center; vertical-align:middle" %)ZCP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
667 |Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
668 |Parameter 3| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●
669 |Parameter 4|●|●|●|●|●| | | | | | | | | | | | |●|
670
671 **Features**
672
673 • 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.
674
675 • Use algebraic methods for size comparison.
676
677
678 [[image:07-1 Basic instructions_html_878004f8efa838b.gif||height="361" width="700"]]
679
680 (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.
681
682 ✎**Note: **
683
684 • Please set the lower comparison value (S1) to a value smaller than the upper comparison value (S2).
685
686 • When (s1) is greater than (S2), it will be processed as (S2)=(S1).
687
688 • The device specified in 3 points (d) is occupied at the beginning. Please be careful not to overlap with other control devices.
689
690 **Error code**
691
692 |Error code|Content
693 |4085H|The output results of (S1), (S2) and (S3) in the read application instruction exceed the device range
694 |4086H|The output result of (D) in write application instructions exceeds the device range
695
696 **Example**
697
698
699 [[image:07-1 Basic instructions_html_db2bc281a152807e.png]]
700
701 When M0 is set, compare whether D0 is between 0 and 1000:
702
703 If (D0)> (1000), then Y0 is ON.
704
705 If (0) ≤ (D0) ≤ (1000), then Y1 is ON.
706
707 If (D0) <(0), then Y2 is ON.
708
709 == DZCP/32-bit data interval comparison ==
710
711 **DZCP(P)**
712
713 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.
714
715 -[DZCP (S1) (S2) (S3) (D)]
716
717 **Content, range and data type**
718
719 |Parameter|Content|Range|Data type|Data type (label)
720 |(S1)|The comparison value data of low limit or the device that stores the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
721 |(S2)|The comparison value data of high limit or the device that stores the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
722 |(S3)|Comparison source data or the device that stores the comparison source data|-2147483648 to 2147483647|Signed BIN32|ANY32_S
723 |(D)|The start bit device of output comparison result| |Bit|ANYBIT_ARRAY
724
725 **Device used**
726
727 |=(% rowspan="2" scope="row" %)Instruction|=(% rowspan="2" %)Parameter|=(% colspan="19" %)Devices|=Offset modification|=(((
728 Pulse extension
729 )))
730 |=Y|M|S|SM|D.b|KnX|KnY|KnM|KnS|T|C|D|R|SD|LC|HSC|K|H|E|[D]|XXP
731 |=(% rowspan="4" %)DZCP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
732 |=Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
733 |=Parameter 3| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
734 |=Parameter 4|●|●|●|●|●| | | | | | | | | | | | | | |●|
735
736 **Features**
737
738 • 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.
739
740 • Use algebraic methods for size comparison.
741
742
743 [[image:07-1 Basic instructions_html_878004f8efa838b.gif||height="361" width="700"]]
744
745 (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.
746
747 ✎**Note: **
748
749 • Please set the lower comparison value (S1) to a value smaller than the upper comparison value (S2).
750
751 • When (S1) is greater than (S2), it will be processed as (S2)=(S1).
752
753 • The device specified in 3 points (D) is occupied at the beginning. Please be careful not to overlap with other control devices.
754
755 **Error code**
756
757 |Error code|Content
758 |4085H|The output results of (S1), (S2) and (S3) in the read application instruction exceed the device range
759 |4086H|The output results of (D) in the write application instruction exceeds the device range
760
761 **Example**
762
763
764 [[image:07-1 Basic instructions_html_a215dc073ae34e2c.png]]
765
766 When M0 is set, compare D0 with whether it is between 0 and 100000:
767
768 If (D0)> (100000), then Y0 is ON.
769
770 If (0) ≤ (D0) ≤ (100000), then Y1 is ON.
771
772 If (D0) <(0), then Y2 is ON.