Wiki source code of 01 Transfer and comparison

Version 26.1 by Leo Wei on 2022/07/18 16:34

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