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