Wiki source code of 12

Version 1.8 by Joey on 2022/06/09 15:52

Show last authors
1 = **Contact comparison instruction** =
2
3 == **Signed 16-bit contact comparison instruction** ==
4
5 **LD £, AND £, OR £**
6
7 The BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2) are compared by normal open contact processing.
8
9 LD£: Normally open contact comparison instruction
10
11 AND£: Normally open contact series connection comparison instruction
12
13 OR£: Normally open contact parallel connection comparison instruction
14
15 **Ladder diagram**
16
17 (% style="text-align:center" %)
18 [[image:07-5 Basic instructions_html_63210db6b7e1512f.png]]
19
20 (You can enter "=", "<>", ">", "<", ">=", "<=" in "£")
21
22 **Content, range and data type**
23
24 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
25 |(s1)|Comparison data or device storing comparison data|-32768 to 32767|Signed BIN 16 bit|ANY16_S
26 |(s2)|Comparison data or device storing comparison data|-32768 to 32767|Signed BIN 16 bit|ANY16_S
27
28 **Device used**
29
30 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="11" %)**Devices**|(((
31 **Offset modification**
32 )))|(((
33 **Pulse extension**
34 )))
35 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
36 |LD=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
37 |LD>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
38 |LD<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
39 |LD>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
40 |LD<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
41 |LD<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
42 |AND=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
43 |AND>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
44 |AND<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
45 |AND>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
46 |AND<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
47 |AND<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
48 |OR=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
49 |OR>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
50 |OR<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
51 |OR>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
52 |OR<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
53 |OR<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|
54
55 **Features**
56
57 The BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2) are compared by normal open contact processing.
58
59 The comparison operation result of each instruction is shown below.
60
61 |**Instruction Sign**|**Condition**|**Comparison operation result**|**Instruction Sign**|**Condition**|**Comparison operation result**
62 |==|(s1)=(s2)|(% rowspan="6" %)On state|==|(s1)≠(s2)|(% rowspan="6" %)Non-conduction state
63 |<>|(s1)≠(s2)|<>|(s1)=(s2)
64 |>|(s1)>(s2)|>|(s1)≤(s2)
65 |<|(s1)<(s2)|<|(s1)≥(s2)
66 |>=|(s1)≥(s2)|>=|(s1)<(s2)
67 |<=|(s1)≤(s2)|<=|(s1)>(s2)
68
69 **Error code**
70
71 |**Error code**|**Content**
72 |4085H|(s) read address exceeds the device range
73
74 **Example**
75
76 (((
77 (1) LD£ instruction:
78
79 (% style="text-align:center" %)
80 [[image:07-5 Basic instructions_html_1309199eccc7134.png]]
81 )))
82
83 When the current value of counter C10 is 200, Y10 is set
84
85 When the content of D200 is above -29, and X1 is ON, Y11 is set
86
87 (2) AND£ instruction:
88
89 (% style="text-align:center" %)
90 [[image:07-5 Basic instructions_html_1c966f74b0bd808e.png]]
91
92 (((
93 When X0 is ON, or when the current value of counter C10 is 200, Y10 is set
94
95 When X1 is OFF, and the content of data counter D0 is not -10, Y11 is set
96
97
98 )))
99
100 (3) OR£ instruction:
101
102 (% style="text-align:center" %)
103 [[image:07-5 Basic instructions_html_8b000809015ea436.png]]
104
105 (((
106 When X1 is ON, or when the current value of counter C10 is 200, Y0 is set
107
108 When X2 and M30 are ON, or the content of register D100 is K10000 and above, M60 is set
109 )))
110
111 == **Signed 32-bit contact comparison instruction** ==
112
113 **LDD £, ANDD £, ORD £**
114
115 The BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2) are compared by normal open contact processing.
116
117 LDD£: Normally open contact comparison command
118
119 ANDD£: Normally open contact series link comparison instruction
120
121 ORD£: Normally open contact parallel link comparison instruction
122
123 **Ladder diagram**
124
125 (% style="text-align:center" %)
126 [[image:07-5 Basic instructions_html_63210db6b7e1512f.png]]
127
128 “=”, “<>”, “>”, “<”, “>=”, “<=” can be input in “£”
129
130 **Content, range and data type**
131
132 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
133 |(s1)|Comparison data or device storing comparison data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S
134 |(s2)|Comparison data or device storing comparison data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S
135
136 **Device used**
137
138 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="13" %)**Devices**|(((
139 **Offset modification**
140 )))|(((
141 **Pulse extension**
142 )))
143 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**[D]**|**XXP**
144 |LDD=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
145 |LDD>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
146 |LDD<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
147 |LDD>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
148 |LDD<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
149 |LDD<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
150 |ANDD=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
151 |ANDD>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
152 |ANDD<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
153 |ANDD>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
154 |ANDD<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
155 |ANDD<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
156 |ORD=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
157 |ORD>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
158 |ORD<|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
159 |ORD>=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
160 |ORD<=|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
161 |ORD<>|s1, s2|●|●|●|●|●|●|●|●|●|●|●|●|●|●|
162
163 **Features**
164
165 The BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2) are compared by normal open contact processing.
166
167 The comparison operation result of each instruction is shown below.
168
169 |**Instruction Sign**|**Condition**|**Comparison operation result**|**Instruction Sign**|**Condition**|**Comparison operation result**
170 |==|(s1)=(s2)|(% rowspan="6" %)On state|==|(s1)≠(s2)|(% rowspan="6" %)Non-conduction state
171 |<>|(s1)≠(s2)|<>|(s1)=(s2)
172 |>|(s1)>(s2)|>|(s1)≤(s2)
173 |<|(s1)<(s2)|<|(s1)≥(s2)
174 |>=|(s1)≥(s2)|>=|(s1)<(s2)
175 |<=|(s1)≤(s2)|<=|(s1)>(s2)
176
177 **Error code**
178
179 |**Error code**|**Content**
180 |4085H|(S) read address exceeds the device range
181
182 **Example**
183
184 (1) LDD£ instruction:
185
186 (% style="text-align:center" %)
187 [[image:07-5 Basic instructions_html_8acf0d489297c561.png]]
188
189 When the data of LC10 is 200000, Y10 is set, otherwise Y10 is reset.
190
191 When the 32-bit data composed of D201 and D200 exceeds -5000, and X1 is ON, Y11 is turned ON.
192
193 (2) ANDD£ instruction:
194
195 (% style="text-align:center" %)
196 [[image:07-5 Basic instructions_html_38be93eec0ced6c.png]]
197
198 When X0 is ON and the value of LC10 is 200000, Y10 is set, otherwise it is reset.
199
200 When X1 is OFF and the 32-bit data composed of D1 and D0 is not equal to K-50000, Y11 is set.
201
202 (3) ORD£ instruction:
203
204 (% style="text-align:center" %)
205 [[image:07-5 Basic instructions_html_8ebfc7b0562cf370.png]]
206
207 When X1 is ON, or the data of LC10 is equal to the data of LC10 is equal to 200000, Y0 is set.
208
209 When X2 and M30 are set, or the double word data composed of D101 and D100 is greater than or equal to 100000, M60 is set.
210
211 == **Single precision real number contact comparison instruction** ==
212
213 **LDE £, ANDE £, ORE £**
214
215 The single precision real number of the device specified in (s1) and the single precision real number of the device specified in (s2) are compared by normal open contact processing.
216
217 LDE£: Normally open contact comparison command
218
219 ANDE£: Normally open contact series link comparison instruction
220
221 ORE£: Normally open contact parallel link comparison instruction
222
223 **Ladder diagram**
224
225 (% style="text-align:center" %)
226 [[image:07-5 Basic instructions_html_6ac28f30e24ad296.png||height="352" width="550"]]
227
228 “=”, “<>”, “>”, “<”, “>=”, “<=” can be input in “£”
229
230 **Content, range and data type**
231
232 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
233 |(s1)|Comparison data or the device start number storing the comparison data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32
234 |(s2)|Comparison data or the device start number storing the comparison data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32
235
236 **Device used**
237
238 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|(((
239 **Offset modification**
240 )))|(((
241 **Pulse extension**
242 )))
243 |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP**
244 |LDE=|s1, s2|●|●|●|●|●|●|●|●|●|
245 |LDE>|s1, s2|●|●|●|●|●|●|●|●|●|
246 |LDE<|s1, s2|●|●|●|●|●|●|●|●|●|
247 |LDE>=|s1, s2|●|●|●|●|●|●|●|●|●|
248 |LDE<=|s1, s2|●|●|●|●|●|●|●|●|●|
249 |LDE<>|s1, s2|●|●|●|●|●|●|●|●|●|
250 |ANDE=|s1, s2|●|●|●|●|●|●|●|●|●|
251 |ANDE>|s1, s2|●|●|●|●|●|●|●|●|●|
252 |ANDE<|s1, s2|●|●|●|●|●|●|●|●|●|
253 |ANDE>=|s1, s2|●|●|●|●|●|●|●|●|●|
254 |ANDE<=|s1, s2|●|●|●|●|●|●|●|●|●|
255 |ANDE<>|s1, s2|●|●|●|●|●|●|●|●|●|
256 |ORE=|s1, s2|●|●|●|●|●|●|●|●|●|
257 |ORD>|s1, s2|●|●|●|●|●|●|●|●|●|
258 |ORE<|s1, s2|●|●|●|●|●|●|●|●|●|
259 |ORE>=|s1, s2|●|●|●|●|●|●|●|●|●|
260 |ORE<=|s1, s2|●|●|●|●|●|●|●|●|●|
261 |ORE<>|s1, s2|●|●|●|●|●|●|●|●|●|
262
263 **Features**
264
265 The single precision real number of the device specified in (s1) and the single precision real number of the device specified in (s2) are compared by normal open contact processing.
266
267 The comparison operation result of each instruction is shown below.
268
269 |**Instruction Sign**|**Condition**|**Comparison operation result**|**Instruction Sign**|**Condition**|**Comparison operation result**
270 |E=|(s1)=(s2)|(% rowspan="6" %)On state|E=|(s1)≠(s2)|(% rowspan="6" %)Non-conduction state
271 |E<>|(s1)≠(s2)|E<>|(s1)=(s2)
272 |E>|(s1)>(s2)|E>|(s1)≤(s2)
273 |E<|(s1)<(s2)|E<|(s1)≥(s2)
274 |E>=|(s1)≥(s2)|E>=|(s1)<(s2)
275 |E<=|(s1)≤(s2)|E<=|(s1)>(s2)
276
277 **Error code**
278
279 |**Error code**|**Content**
280 |4084H|When the content of the specified device by (s1) and (s2) is an irregular number, a non-number, or ±∞
281 |4085H|The read address of (s1) and (s2exceeds the device range
282
283 **Example**
284
285 (1) LDE£ instruction:
286
287 (% style="text-align:center" %)
288 [[image:07-5 Basic instructions_html_c4c820cf59601493.png]]
289
290 When the real number input in D0 is equal to E1.23, Y10 is ON, otherwise Y10 is OFF.
291
292 When the real number in R0 is greater than or equal to the real number in LC0, Y11 is ON, otherwise it is OFF.
293
294 If the input in D0, R0, LC0 is not a real number, it will report H4084 error.
295
296 (2) ANDE£ instruction:
297
298 (% style="text-align:center" %)
299 [[image:07-5 Basic instructions_html_7cdd2117360e179b.png]]
300
301 Only when M0 is ON and D2 real number is not equal to E1.23 and R2 real number is less than real number LC2 , Y12 is ON, otherwise all are OFF.
302
303 (3) ORE£ instruction:
304
305 (% style="text-align:center" %)
306 [[image:07-5 Basic instructions_html_3eba0bd56176441d.png]]
307
308 When the real number of R4 is less than or equal to the real number of R15, or the real number R6 is equal to the real number R20, Y13 is ON, otherwise Y13 is OFF.
309
310 == **String comparison** ==
311
312 **LDS£、ANDS£、 ORS£**
313
314 Compare the string stored after the device number specified in (s1) with the string stored after the device number specified in (s2).
315
316 LDS£: String comparison instruction
317
318 ANDS£: String serial connection comparison instruction
319
320 ORS£: String parallel connection comparison instruction
321
322 **Ladder diagram**
323
324 (% style="text-align:center" %)
325 [[image:07-5 Basic instructions_html_5fb3b3b70645fef5.png||height="371" width="550"]]
326
327 “=” and “<>” could be entered in “£”
328
329 **Content, range and data type**
330
331 |**Parameter**|**Content**|**Range**|**Date type**|**Date type(label)**
332 |(S1)|Connection data or the device start number storing the data or the string specified directly|-|String|ANYSTRING_SINGLE
333 |(S1)|Connection data or the device start number storing the data or the string specified directly|-|String|ANYSTRING_SINGLE
334
335 **Device used**
336
337 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="9" %)**Devices**|(((
338 **Offset modification**
339 )))|(((
340 **Pulse extension**
341 )))
342 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
343 |LDS=|s1、s2|●|●|●|●|●|●|●|●|●|●|
344 |LDS<>|s1、s2|●|●|●|●|●|●|●|●|●|●|
345 |ANDS=|s1、s2|●|●|●|●|●|●|●|●|●|●|
346 |ANDS<>|s1、s2|●|●|●|●|●|●|●|●|●|●|
347 |ORS=|s1、s2|●|●|●|●|●|●|●|●|●|●|
348 |ORS<>|s1、s2|●|●|●|●|●|●|●|●|●|●|
349
350 **Features**
351
352 • Compare the string stored after the device number specified in (s1) with the string stored after the device number specified in (s2).
353
354 • The comparison operation result of each instruction is shown below.
355
356 |**Instruction sign**|**Condition**|**Comparison operation result**|**Instruction sign**|**Condition**|**Comparison operation result**
357 |==|(s1)=(s2)|(% rowspan="2" %)On stat|==|(s1)≠(s2)|(% rowspan="2" %)Non-conduction state
358 |<>|(s1)≠(s2)|<>|(s1)=(s2)
359
360 **Error code**
361
362 |**Error code**|**Content**
363 |4085H|The read address of (s1) or (s2) exceeds the device range
364 |408AH|The length of the read string of (s1) or (s2) exceeds, and the continuous length of the string exceeds 400 characters.
365 |408BH|When (s1) or (s2) reading the string, the maximum range of the device is read but 00H is not found as the end.
366
367 **Example**
368
369 (1) LDS£ instruction:
370
371 (% style="text-align:center" %)
372 [[image:07-5 Basic instructions_html_449a071f61ff5b58.png]]
373
374 (2) ANDS£ instruction:
375
376 (% style="text-align:center" %)
377 [[image:07-5 Basic instructions_html_dd6aa995d193bdd2.png]]
378
379 (3) ORS£ instruction:
380
381 (% style="text-align:center" %)
382 [[image:07-5 Basic instructions_html_4f8fb7c94f87c58d.png]]
383
384 = **Clock operation instruction** =
385
386 == **TADD/The addition of clock data** ==
387
388 **TADD(P)**
389
390 Add the time data stored after the device number specified in (s1) and the time data stored after the device number specified in (s2), and store the result of the addition operation after the device number specified in (d) .
391
392 -[TADD (s1) (s2) (d)]
393
394 **Content, range and data type**
395
396 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
397 |(s1)|The device start number that stores the added time data|-|Signed BIN 16 bit|(((
398 ANY16_ARRAY
399
400 (number of elements: 3)
401 )))
402 |(s2)|The device start number that stores the addition operation time (time) data|-|Signed BIN 16 bit|(((
403 ANY16_ARRAY
404
405 (number of elements: 3)
406 )))
407 |(d)|The device start number that stores the time (time) data of the addition operation result|-|Signed BIN 16 bit|(((
408 ANY16_ARRAY
409
410 (number of elements: 3)
411 )))
412
413 **Device used**
414
415 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="5" %)**Devices**|(((
416 **Offset modification**
417 )))|(((
418 **Pulse extension**
419 )))
420 |**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
421 |(% rowspan="3" %)TADD|Parameter 1|●|●|●|●|●|●|●
422 |Parameter 2|●|●|●|●|●|●|●
423 |Parameter 3|●|●|●|●|●|●|●
424
425 **Features**
426
427 Add the time data specified in (s1) and the time data specified in (s2), and store the result of the addition in the device number specified in (d) or later.
428
429 (% style="text-align:center" %)
430 [[image:07-5 Basic instructions_html_37222a6e282347f9.png||height="79" width="750"]]
431
432 **Example**
433
434 When 6:32:40 and 7:48:10 are added together
435
436 (% style="text-align:center" %)
437 [[image:07-5 Basic instructions_html_90138670198ab422.png||height="94" width="750"]]
438
439 When the calculation result time exceeds 24 o'clock, the carry flag turns ON, and the value after 24 hours is subtracted becomes the calculation result. For example, when 14:20:30 and 20:20:20 are added, the result is not 34:40:50, but 10:40:50.
440
441 (% style="text-align:center" %)
442 [[image:07-5 Basic instructions_html_bac419ce2dc0dc2.png||height="91" width="750"]]
443
444 When the calculation result is 0 (0 hour, 0 minute, 0 second), the zero flag turns on.
445
446 When 23:59:59 and 1 second are added, the result of the calculation is 0:00:00, and the carry flag and zero flag are turned on.
447
448 Related device are as follows:
449
450 |**Devices**|**Name**|**Content**
451 |SM151|Carry|It is ON when the result of the TADD(P) instruction exceeds the maximum clock data value of 23:59:59
452 |SM153|Zero|It is ON when the result of the TADD(P) instruction is 0:00:00
453
454 ✎**Note:**
455
456 The devices specified in (s1), (s2), (d) occupy 3 points respectively. Be careful not to overlap with the device used for machine control.
457
458 When using the clock data time (hour, minute, second) of the built-in real-time clock of the CPU module, use the TRD(P) instruction to read the value of the special register and assign the word device to each operand.
459
460 **Error code**
461
462 |**Error code**|**Content**
463 |4085H|When reading the specified device range exceeds the corresponding device range
464 |4086H|When writing the specified device range exceeds the corresponding device range
465 |4084H|(((
466 When the values specified in (s1) and (s2) are other than 0 to 23
467
468 When the values specified in (s1)+1, (s2)+1, (s1)+2 and (s2)+2 are other than 0 to 59
469 )))
470
471 **Example**
472
473 (% style="text-align:center" %)
474 [[image:07-5 Basic instructions_html_4f75eedee7172bbb.png||height="35" width="349"]]
475
476 Set D0 time to 16:30:00 and D10 time to 4:30:0
477
478 (% style="text-align:center" %)
479 [[image:07-5 Basic instructions_html_c64e0faf2af172f8.png]]
480
481 (% style="text-align:center" %)
482 [[image:07-5 Basic instructions_html_66e3a2eadeb2ecbb.png]]
483
484 After the coil is turned on, the D20 time is 21:0:0
485
486 (% style="text-align:center" %)
487 [[image:07-5 Basic instructions_html_a9b235835aa41200.png]]
488
489 == **TSUB/The subtraction of clock data** ==
490
491 **TSUB(P)**
492
493 Subtract the time data stored after the device number specified in (s1) and the time data stored after the device number specified in (s2), and store the subtraction result in the device number specified in (d) or later .
494
495 -[TSUB (s1) (s2) (d)]
496
497 **Content, range and data type**
498
499 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
500 |(s1)|The device start number that stores the subtracted time data|-|Signed BIN 16 bit|(((
501 ANY16_ARRAY
502
503 (number of elements: 3)
504 )))
505 |(s2)|The device start number that stores the subtraction operation time (time) data|-|Signed BIN 16 bit|(((
506 ANY16_ARRAY
507
508 (number of elements: 3)
509 )))
510 |(d)|The device start number that stores the time (time) data of the subtraction result|-|Signed BIN 16 bit|(((
511 ANY16_ARRAY
512
513 (number of elements: 3)
514 )))
515
516 **Device used**
517
518 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="5" %)**Devices**|(((
519 **Offset modification**
520 )))|(((
521 **Pulse extension**
522 )))
523 |**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
524 |(% rowspan="3" %)TSUB|Parameter 1|●|●|●|●|●|●|●
525 |Parameter 2|●|●|●|●|●|●|●
526 |Parameter 3|●|●|●|●|●|●|●
527
528 **Features**
529
530 Subtract the time data specified in (s1) and the time data specified in (s2), and store the subtraction result in the device number specified in (d) or later.
531
532 (% style="text-align:center" %)
533 [[image:07-5 Basic instructions_html_5a93455e4cd8a27.png]]
534
535 **Example**
536
537 When subtracting 10:40:20 and 3:50:10
538
539 (% style="text-align:center" %)
540 [[image:07-5 Basic instructions_html_2473f03fc493780c.png]]
541
542 When the calculation result time is a negative number, the borrow flag turns on and the data +24 is the calculation result. For example, in the case of subtracting 4:50:32 and 10:42:12, the result is not -6:8:20, but 18:8:20.
543
544 (% style="text-align:center" %)
545 [[image:07-5 Basic instructions_html_24b998b4c3c4ec73.png]]
546
547 When the calculation result is 0 (0 hour, 0 minute, 0 second), the zero flag turns on.
548
549 Related device are as follows:
550
551 |**Devices**|**Name**|**Content**
552 |SM152|Borrow|It is ON when the result of the TSUB(P) instruction is less than 0:00:00
553 |SM153|Zero|It is ON when the result of the TSUB(P) instruction is at the time of 0:00:00:00
554
555 ✎**Note:**
556
557 • The devices specified in (s1), (s2), and (d) occupy 3 points respectively. Be careful not to overlap with the device used for machine control.
558
559 • When using the clock data time (hour, minute, second) of the built-in real-time clock of the CPU module, use the TRD(P) instruction to read the value of the special register and assign the word device to each operand.
560
561 **Error code**
562
563 |**Error code**|**Content**
564 |4085H|When reading the specified device range exceeds the corresponding device range
565 |4086H|When writing the specified device range exceeds the corresponding device range
566 |4084H|(((
567 When the values specified in (s1) and (s2) are other than 0 to 23
568
569 When the values specified in (s1)+1, (s2)+1, (s1)+2 and (s2)+2 are other than 0 to 59
570 )))
571
572 **Example**
573
574 (% style="text-align:center" %)
575 [[image:07-5 Basic instructions_html_e3a5d4793d3ccd2d.png||height="36" width="372"]]
576
577 Set D0 time to 16:30:00 and D10 time to 4:30:0
578
579 (% style="text-align:center" %)
580 [[image:07-5 Basic instructions_html_c64e0faf2af172f8.png]]
581
582 (% style="text-align:center" %)
583 [[image:07-5 Basic instructions_html_66e3a2eadeb2ecbb.png]]
584
585 After the coil is turned on, the D20 time is 12:00:00
586
587 (% style="text-align:center" %)
588 [[image:07-5 Basic instructions_html_8f93ea19ba10652b.png]]
589
590 **TRD/Clock data reading**
591
592 **TRD(P)**
593
594 Read the clock data of the built-in real-time clock of the CPU module.
595
596 -[TRD (d)]
597
598 **Content, range and data type**
599
600 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
601 |(d)|Read destination and start device number of clock data|-|Signed BIN 16 bit|(((
602 ANY16_ARRAY
603
604 (number of elements: 7)
605 )))
606
607 **Device used**
608
609 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="4" %)**Devices**|(((
610 **Offset modification**
611 )))|(((
612 **Pulse extension**
613 )))
614 |**T**|**C**|**D**|**R**|**[D]**|**XXP**
615 |TRD|Parameter 1|●|●|●|●|●|●
616
617 **Features**
618
619 Read the clock data (SD100 to SD106) of the real-time clock built into the CPU module into (d) to (d)+6 in the following format.
620
621 |**Parameter**|**Element**|**Project**|**Clock data**| |**Element**|**Project**
622 |(% rowspan="7" %)Special register|SD105|Year (Gregorian)|2000 to 2099|→|(d)|Year (Gregorian)
623 |SD104|Month|1 to 12|→|(d)+1|Month
624 |SD103|Day|1 to 31|→|(d)+2|Day
625 |SD102|Hour|0 to 23|→|(d)+3|Hour
626 |SD101|Minute|0 to 59|→|(d)+4|Minute
627 |SD100|Seconds|0 to 59|→|(d)+5|Seconds
628 |SD106|Week|0 (Sun) to 6 (Sat)|→|(d)+6|Week
629
630 • The related devices are shown below. The clock data of these special registers are updated through END processing.
631
632 |**Devices**|**Content**
633 |SD100|The second data of the clock data is stored in BIN code.
634 |SD101|The sub-data of the clock data is stored in BIN code.
635 |SD102|Time data of clock data is stored in BIN code.
636 |SD103|The daily data of the clock data is stored in BIN code.
637 |SD104|The monthly data of the clock data is stored in BIN code.
638 |SD105|The year data of the clock data is stored in a 4-digit BIN code of the Gregorian calendar.
639 |SD106|The week data of the clock data is stored in BIN code. (0: day, 1: one, ..., 6: six) are stored in BIN code.
640
641 ✎**Note:**
642
643 • The device specified in (d) occupies 7 points. Be careful not to overlap with the device used for machine control.
644
645 **Error code**
646
647 |**Error code**|**Content**
648 |4086H|When reading the specified device range exceeds the corresponding device range
649
650 **Example**
651
652 (% style="text-align:center" %)
653 [[image:07-5 Basic instructions_html_b81c1991fec5b4b1.png||height="68" width="250"]]
654
655 After the M0 coil is turned on, the current date and time are read as 2020-2-19 13:10:38 Wednesday
656
657 (% style="text-align:center" %)
658 [[image:07-5 Basic instructions_html_fe82ecd18ebfd787.png||height="48" width="602"]]
659
660 == **TWR/Clock data writing** ==
661
662 **TWR(P)**
663
664 Write the clock data of the built-in real-time clock of the CPU module.
665
666 -[TWR (s)]
667
668 **Content, range and data type**
669
670 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
671 |(s)|Clock data write source, start device number|-|Signed BIN 16 bit|ANY16_ARRAY (number of elements: 7)
672
673 **Device used**
674
675 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="4" %)**Devices**|(((
676 **Offset modification**
677 )))|(((
678 **Pulse extension**
679 )))
680 |**T**|**C**|**D**|**R**|**[D]**|**XXP**
681 |TWR|Parameter 1|●|●|●|●|●|●
682
683 **Features**
684
685 Write the set clock data (s) to (s)+6 to the clock data (SD100 to SD106) of the real-time clock built into the CPU module.
686
687 |(% colspan="3" %)**Set data at all times**|(% rowspan="2" %) |(% colspan="2" %)**Special register**
688 |**Element**|**Project**|**Clock data**|**Element**|**Project**
689 |(s)|Year (Gregorian)|2000 to 2099 or 0 to 99|→|SD105|Year (Gregorian)
690 |(s)+1|Month|1 to 12|→|SD104|Month
691 |(s)+2|Day|1 to 31|→|SD103|Day
692 |(s)+3|Hour|0 to 23|→|SD102|Hour
693 |(s)+4|Minute|0 to 59|→|SD101|Minute
694 |(s)+5|Seconds|0 to 59|→|SD100|Seconds
695 |(s)+6|Week|0 (Sun) to 6 (Sat)|→|SD106|Week
696
697 • If the TWR(P) instruction is executed, the clock data of the real-time clock is changed immediately. Therefore, the clock data after a few minutes should be transferred to the set clock data (s) to (s)+6 in advance, and the instruction will be executed when the correct time is reached.
698
699 • If the year in (s) is in the range of 0 to 99, it will be automatically treated as 2000 to 2099.
700
701 • When a value indicating an impossible time is set, the clock data will not be updated. Set the correct clock data and write again.
702
703 • The day of the week (SD100) is automatically corrected.
704
705 • The related devices are shown below.
706
707 |**Devices**|**Content**
708 |SD100|The second data of the clock data is stored in BIN code.
709 |SD101|The sub-data of the clock data is stored in BIN code.
710 |SD102|Time data of clock data is stored in BIN code.
711 |SD103|The daily data of the clock data is stored in BIN code.
712 |SD104|The monthly data of the clock data is stored in BIN code.
713 |SD105|The year data of the clock data is stored in a 4-digit BIN code of the Gregorian calendar.
714 |SD106|The week data of the clock data is stored in BIN code. (0: day, 1: one, ..., 6: six) are stored in BIN code.
715
716 ✎**Note:**
717
718 The device specified in (s) occupies 7 points. Be careful not to overlap with the device used for machine control.
719
720 **Error code**
721
722 |**Error code**|**Content**
723 |4085H|When reading the specified device range exceeds the corresponding device range
724
725 **Example**
726
727 Set D0 date and time to 2020-2-19 12:36:00 in advance
728
729 (% style="text-align:center" %)
730 [[image:07-5 Basic instructions_html_994c66d1a4cbd45f.png||height="57" width="305"]]
731
732 At the moment when the time 12:36:00 arrives, turn on the M0 coil and write the time.
733
734 (% style="text-align:center" %)
735 [[image:07-5 Basic instructions_html_bf3e906ee5265598.png||height="42" width="586"]]
736
737 == **HTOS/16-bit data conversion of time data (hour, minute, second → second)** ==
738
739 **HTOS(P)**
740
741 Convert the time data stored after the device number specified in (s) into seconds and store the conversion result as BIN 16-bit data in the device specified in (d).
742
743 -[HTOS (s) (d)]
744
745 **Content, range and data type**
746
747 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
748 |(s)|The device start number that stores the data of the subtracted time|-|Signed BIN 16 bit|ANY16_ARRAY (number of elements: 3)
749 |(d)|The device start number that stores the converted clock data|-|Signed BIN 16 bit|ANY16
750
751 **Device used**
752
753 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="9" %)**Devices**|**Offset modification**|(((
754 **Pulse extension**
755 )))
756 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
757 |(% rowspan="2" %)HTOS|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
758 |Parameter 2| |●|●|●|●|●|●|●|●|●|●
759
760 **Features**
761
762 Convert the time data stored after the device number specified in (s) into seconds and store the conversion result in the device specified in (d).
763
764 (% style="text-align:center" %)
765 [[image:07-5 Basic instructions_html_a84b7741fd5bef2f.png||height="130" width="550"]]
766
767 **Example**
768
769 When 4 hours, 29 minutes and 31 seconds are specified in (s)
770
771 (% style="text-align:center" %)
772 [[image:07-5 Basic instructions_html_5effb7bc9b8e5cf7.png||height="162" width="550"]]
773
774 **Error code**
775
776 |**Error code**|**Content**
777 |4085H|When reading the specified device range exceeds the corresponding device range
778 |4086H|When writing the specified device range exceeds the corresponding device range
779 |4084H|(((
780 When the calculation result is not in the range of 0 to 32767
781
782 When the value specified in (s) is not in the range of 0 to 9
783
784 When the value specified in (s)+1 and (s)+2 is not in the range of 0 to 59
785 )))
786
787 **Example**
788
789 (% style="text-align:center" %)
790 [[image:07-5 Basic instructions_html_e23e38c4ba4c34bb.png||height="43" width="338"]]
791
792 D0 time is set to 5:36:53
793
794 (% style="text-align:center" %)
795 [[image:07-5 Basic instructions_html_2866a121e5ca5713.png]]
796
797 The time of D10 after the M0 coil is turned on is as below.
798
799 (% style="text-align:center" %)
800 [[image:07-5 Basic instructions_html_1dd6c5de05890797.png]]
801
802 == **DHTOS/32-bit data conversion of time data (hour, minute, second → second)** ==
803
804 **DHTOS(P)**
805
806 Convert the time data stored after the device number specified in (s) into seconds and store the conversion result as BIN 32-bit data in the device specified in (d).
807
808 -[DHTOS (s) (d)]
809
810 **Content, range and data type**
811
812 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
813 |(s)|The device start number that stores the data of the subtracted time|-|Signed BIN 16 bit|ANY16_ARRAY (number of elements: 3)
814 |(d)|The device start number that stores the converted clock data|-|Signed BIN 32 bit|ANY32
815
816 **Device used**
817
818 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="9" %)**Devices**|(((
819 **Offset modification**
820 )))|(((
821 **Pulse extension**
822 )))
823 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
824 |(% rowspan="2" %)DHTOS|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
825 |Parameter 2| |●|●|●|●|●|●|●|●|●|●
826
827 **Features**
828
829 Convert the time data stored after the device number specified in (s) into seconds and store the conversion result in the device specified in (d).
830
831 (% style="text-align:center" %)
832 [[image:07-5 Basic instructions_html_f4be08508575ea01.png||height="99" width="550"]]
833
834 **Example**
835
836 When 35 hours, 10 minutes and 58 seconds are specified in (s)
837
838 (% style="text-align:center" %)
839 [[image:07-5 Basic instructions_html_5b9ad230ed5e1fd0.png||height="125" width="550"]]
840
841 **Error code**
842
843 |**Error code**|**Content**
844 |4085H|When reading the specified device range exceeds the corresponding device range
845 |4086H|When writing the specified device range exceeds the corresponding device range
846 |4084H|(((
847 When the calculation result is not in the range of 0 to 32767
848
849 When the value specified in (s)+1 and (s)+2 is not in the range of 0 to 59
850 )))
851
852 **Example**
853
854 (% style="text-align:center" %)
855 [[image:07-5 Basic instructions_html_ae8ab4379e8bdb91.png||height="45" width="263"]]
856
857 D0 time is set to 15:33:24
858
859 (% style="text-align:center" %)
860 [[image:07-5 Basic instructions_html_57a15d9e1045e93e.png||height="41" width="313"]]
861
862 The second of D10 after the M0 coil is turned on is
863
864 (% style="text-align:center" %)
865 [[image:07-5 Basic instructions_html_194e906b1dc12078.png||height="64" width="365"]]
866
867 **HOUR/Hour measuring 16-bit**
868
869 **HOUR(P)**
870
871 The time for the input contact to be ON is measured in units of one hour.C
872
873 -[HOUR (s) (d1) (d2)]
874
875 **Content, range and data type**
876
877 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
878 |(s)|(((
879 The time when the alarm (d2) is turned ON
880
881 (set by one hour)
882 )))|K0 to K32767|Signed BIN 16 bit|ANY16
883 |(d1)|Device that stores the current value of measurement (specified data register for power failure retention)|-|Unsigned BIN 16 bit|(((
884 ANY16_ARRAY
885
886 (Number of elements: 2)
887 )))
888 |(d2)|Device that turns ON when the time limit expires (alarm output)|-|Bit|ANY_BOOL
889
890 **Device used**
891
892 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="17" %)**Devices**|(((
893 **Offset modification**
894 )))|(((
895 **Pulse extension**
896 )))
897 |**Y**|**M**|**S**|**SM**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**E**|**[D]**|**XXP**
898 |(% rowspan="3" %)HOUR|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●| |●|●
899 |Parameter 2| | | | | | | | | | | |●|●|●| | | |●|●
900 |Parameter 3|●|●|●|●|●| | | | | | | | | | | | |●|●
901
902 **Features**
903
904 The input contact ON time is measured in units of 1 hour. When the cumulative ON time exceeds the time (BIN 16-bit data) specified in (s), the device specified in (d2) is turned on .
905
906 • In (s), set the time until the alarm (d2) turns ON in units of 1 hour.
907
908 • (d1) stores the current measured value in units of 1 hour.
909
910 • If the median value of (d1) exceeds 32767, it will be modified to 32767.
911
912 • (d1)+1 stores the current measured value (in units of 1 second) that is less than 1 hour.
913
914 • (d2) turns on when the current value (d1) exceeds the time specified in (s).
915
916 • In order to continue to use the current value data even after the power of the CPU module is turned off, specify the data register for power failure retention to (d1). If you use general-purpose data registers, the current value data will be cleared by powering off the CPU module and STOP→RUN operations.
917
918 • After the alarm output specified in (d2) turns ON, measurement will continue.
919
920 • The measurement stops when the current value reaches the 16-bit maximum. To continue the measurement, clear the current value of (d1) to (d1)+1.
921
922 ✎**Note:**
923
924 • The device specified in (d1) occupies 2 points. Be careful not to overlap with the device used for machine control.
925
926 • After the instruction stops running, the measurement stops and the output continues to be maintained.
927
928 **Error code**
929
930 |**Error code**|**Content**
931 |4085H|When reading the specified device range exceeds the corresponding device range
932 |4086H|When writing the specified device range exceeds the corresponding device range
933 |4084H|When the value of (s) is negative
934
935 **Example**
936
937 (% style="text-align:center" %)
938 [[image:07-5 Basic instructions_html_7570f8c392470a9f.png||height="45" width="320"]]
939
940 When M0 = ON, the duration of the state is accumulated, the time is recorded in D0, and the seconds less than 1 hour are recorded in D1. When the accumulated time of D0 reaches 98 hours, the Y0 output state is ON. When the timing conditions are met, after reaching the specified value (K98), the accumulated timing will continue and the reading will continue to increase; the current time value D0 reaches the maximum value of 32767 hours and D1 reaches 3599 seconds, the timing measurement will stop. The current time values D0 and D1 are cleared to 0.
941
942 == **DHOUR/Hour measuring 32 bits** ==
943
944 **DHOUR(P)**
945
946 The time for the input contact to be ON is measured in units of one hour.
947
948 -[DHOUR (s) (d1) (d2)]
949
950 **Content, range and data type**
951
952 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
953 |(s)|(((
954 The time when the alarm (d2) is turned ON (set by one hour)
955 )))|0 to 2147483647|Signed BIN 32 bit|ANY32
956 |(d1)|Device that stores the current value of measurement (specified data register for power failure retention)|-|Unsigned BIN 32 bit|(((
957 ANY32_ARRAY
958
959 (Number of elements: 2)
960 )))
961 |(d2)|Device that turns ON when the time limit expires (alarm output)|-|Bit|ANY_BOOL
962
963 **Device used**
964
965 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="18" %)**Devices**|(((
966 **Offset modification**
967 )))|(((
968 **Pulse extension**
969 )))
970 |**Y**|**M**|**S**|**SM**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**[D]**|**XXP**
971 |(% rowspan="3" %)DHOUR|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
972 |Parameter 2| | | | | | | | | | | |●|●|●| | | | |●|●
973 |Parameter 3|●|●|●|●|●| | | | | | | | | | | | | |●|●
974
975 **Features**
976
977 • The input contact ON time is measured in units of 1 hour. When the cumulative ON time exceeds the time (BIN 32-bit data) specified in (s), the device specified in (d2) is set to ON.
978
979 • In (s)+1, (s), set the time until the alarm (d2) turns ON in units of 1 hour.
980
981 • (D1)+1 and (d1) store the current value measured in units of 1 hour. ((d1)+1: high bit, (d1): low bit)
982
983 • If the median of (d1)+1 and (d1) exceeds 2147483647, it will be modified to 2147483647.
984
985 • (D1)+2 stores the current value (in units of 1 second) of the measurement that is less than 1 hour.
986
987 • (D2) turns on when the current value (d1)+1, (d1) exceeds the time specified in (s).
988
989 • In order to continue to use the current value data even after the power of the CPU module is turned off, specify the data register for power failure retention to (d1). If you use general-purpose data registers, the current value data will be cleared by powering off the CPU module and STOP→RUN operations.
990
991 • After the alarm output specified in (d2) turns on, the measurement will continue.
992
993 • The measurement stops when the current value reaches the 32-bit maximum. To continue the measurement, clear the current value of (d1) to (d1)+2.
994
995 ✎**Note:**
996
997 • The device specified in (d1) occupies 3 points. Be careful not to overlap with the device used for machine control.
998
999 • After the instruction stops running, the measurement stops and the output continues to be maintained.
1000
1001 **Error code**
1002
1003 |**Error code**|**Content**
1004 |4085H|When reading the specified device range exceeds the corresponding device range
1005 |4086H|When writing the specified device range exceeds the corresponding device range
1006 |4084H|When the value of (s) is negative
1007
1008 **Example**
1009
1010 (% style="text-align:center" %)
1011 [[image:07-5 Basic instructions_html_3f1ef5ecc835de30.png||height="43" width="448"]]
1012
1013 When M0=ON, the duration of this state is accumulated, the time is recorded in D1, D0, and the seconds less than 1 hour are recorded in D2. When the accumulated time of D1, D0 reaches 1000 hours, the Y0 output state is ON. When the timing conditions are met, after reaching the specified value (K1000), the accumulated timing will continue, and the reading will continue to increase; the current time values D1 and D0 reach the maximum value of 2147483647 hours, and when D2 reaches 3599 seconds, the timing measurement will stop and the timing should be restarted. The current time values D0, D1, and D2 must be cleared to 0.
1014
1015 == **STOH/16-bit data conversion of time data (second → hour, minute, second)** ==
1016
1017 **STOH(P)**
1018
1019 Convert the second 16-bit data stored in the device number specified in (s) into hour, minute, and second, and store the conversion result in the device specified in (d) and later.
1020
1021 -[STOH (s) (d)]
1022
1023 **Content, range and data type**
1024
1025 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1026 |(s)|The device start number that stores the clock data before conversion|0 to 32767|Signed BIN 16 bit|ANY16
1027 |(d)|The device start number that stores the converted clock data|-|Signed BIN 16 bit|(((
1028 ANY16_ARRAY (number of elements: 3)
1029 )))
1030
1031 **Device used**
1032
1033 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="9" %)**Devices**|(((
1034 **Offset modification**
1035 )))|(((
1036 **Pulse extension**
1037 )))
1038 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
1039 |(% rowspan="2" %)STOH|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
1040 |Parameter 2| |●|●|●|●|●|●|●|●|●|●
1041
1042 **Features**
1043
1044 Convert the second data stored after the device number specified in (s) into hour, minute, and second, and store the conversion result in the device specified in (d) and later.
1045
1046 (% style="text-align:center" %)
1047 [[image:07-5 Basic instructions_html_1f5f3f1d80af2a34.png||height="110" width="550"]]
1048
1049 **Example**
1050
1051 When 29,011 seconds are specified in (s)
1052
1053 (% style="text-align:center" %)
1054 [[image:07-5 Basic instructions_html_682516cbf773f515.png||height="163" width="550"]]
1055
1056 **Error code**
1057
1058 |**Error code**|**Content**
1059 |4085H|When reading the specified device range exceeds the corresponding device range
1060 |4086H|When writing the specified device range exceeds the corresponding device range
1061 |4084H|When the value of (s) exceeds the range
1062
1063 **Example**
1064
1065 (% style="text-align:center" %)
1066 [[image:07-5 Basic instructions_html_e783349d57adf7d2.png||height="47" width="350"]]
1067
1068 Set D0 seconds to 12537
1069
1070 The hour, minute and second of D10 after the M0 coil is turned on are
1071
1072 (% style="text-align:center" %)
1073 [[image:07-5 Basic instructions_html_d3c33949e8684891.png||height="52" width="645"]]
1074
1075 == **DSTOH/32-bit data conversion of time data (second → hour, minute, second)** ==
1076
1077 **DSTOH(P)**
1078
1079 Convert the second 32-bit data of second stored in the device number specified in (s) into hour, minute, and second, and store the conversion result in the device specified in (d) and later.
1080
1081 -[DSTOH (s) (d)]
1082
1083 **Content, range and data type**
1084
1085 |**Parameter**|**Content**|**Range**|**Data type**|**Data &nbsp;&nbsp;&nbsp;&nbsp;type (label)**
1086 |(s)|The device start number that stores the clock data before conversion|0 to 117964799|Signed BIN 32 bit|ANY32
1087 |(d)|The device start number that stores the converted clock data|-|Signed BIN 16 bit|(((
1088 ANY16_ARRAY (number of elements: 3)
1089 )))
1090
1091 **Device used**
1092
1093 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="9" %)**Devices**|(((
1094 **Offset modification**
1095 )))|(((
1096 **Pulse extension**
1097 )))
1098 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
1099 |(% rowspan="2" %)DSTOH|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
1100 |Parameter 2| |●|●|●|●|●|●|●|●|●|●
1101
1102 **Features**
1103
1104 Convert the second data stored after the device number specified in (s) into hour, minute, and second, and store the conversion result in the device specified in (d) and later.
1105
1106 (% style="text-align:center" %)
1107 [[image:07-5 Basic instructions_html_cbf13fc3d10fbe61.png||height="99" width="600"]]
1108
1109 **Example**
1110
1111 When 45,325 seconds is specified in (s)
1112
1113 (% style="text-align:center" %)
1114 [[image:07-5 Basic instructions_html_d6045506b13275a0.png||height="135" width="600"]]
1115
1116 **Error code**
1117
1118 |**Error code**|**Content**
1119 |4085H|When reading the specified device range exceeds the corresponding device range
1120 |4086H|When writing the specified device range exceeds the corresponding device range
1121 |4084H|When the value of (s) exceeds the range
1122
1123 **Example**
1124
1125 (% style="text-align:center" %)
1126 [[image:07-5 Basic instructions_html_e7dd49d953db6da4.png||height="39" width="316"]]
1127
1128 Set D0 seconds to 2152537
1129
1130 The hour, minute and second of D10 after the M0 coil is turned on are
1131
1132 (% style="text-align:center" %)
1133 [[image:07-5 Basic instructions_html_10d57bde1ac0a218.png||height="52" width="661"]]
1134
1135 == **TCMP/Clock data comparison** ==
1136
1137 **TCMP(P)**
1138
1139 Compare the comparison time specified in (s1), (s2), (s3) with the time data specified in (s4), and turn the bit device specified in (d) ON/OFF according to their size match.
1140
1141 -[TCMP (s1) (s2) (s3) (s4) (d)]
1142
1143 **Content, range and data type**
1144
1145 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1146 |(s1)|Specify the "hour" of the comparison base time.|0 to 23|Signed BIN 16 bit|ANY16
1147 |(s2)|Specify the "minute" of the comparison base time.|0 to 59|Signed BIN 16 bit|ANY16
1148 |(s3)|Specify the "second" of the comparison base time.|0 to 59|Signed BIN 16 bit|ANY16
1149 |(s4)|Specify the "hour" of the time data (hour, minute, second).|-|Signed BIN 16 bit|ANY16_ARRAY
1150 |(d)|The bit device is turned ON/OFF according to the comparison result.|-|Bit|ANYBIT_ARRAY
1151
1152 **Device used**
1153
1154 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="17" %)**Devices**|(((
1155 **Offset modification**
1156 )))|(((
1157 **Pulse extension**
1158 )))
1159 |**Y**|**M**|**S**|**SM**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**E**|**[D]**|**XXP**
1160 |(% rowspan="5" %)TCMP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●| |●|●
1161 |Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●| |●|●
1162 |Parameter 3| | | | | |●|●|●|●|●|●|●|●|●|●|●| |●|●
1163 |Parameter 4| | | | | | | | | |●|●|●|●|●| | | |●|●
1164 |Parameter 5|●|●|●|●|●| | | | | | | | | | | | |●|●
1165
1166 **Features**
1167
1168 Compare the time of the reference time (hour, minute, second) [(s1), (s2), (s3)] with the time data (hour, minute, second) [(s4), (s4)+1, (s4) +2] Compare the size and turn on/off the 3 points from (d) according to the result of the same size.
1169
1170 (% style="text-align:center" %)
1171 [[image:07-5 Basic instructions_html_5df7ad3057fada12.png||height="385" width="750"]]
1172
1173 ✎**Note:**
1174
1175 The device specified in (s4) and (d) occupies 3 points. Be careful not to overlap with the device used for machine control.
1176
1177 When using the clock data time (hour, minute, second) of the built-in real-time clock of the CPU module, use the TRD(P) instruction to read the value of the special register and assign the word device to each operand.
1178
1179 **Error code**
1180
1181 |**Error code**|**Content**
1182 |4085H|When reading the specified device range exceeds the corresponding device range
1183 |4086H|When writing the specified device range exceeds the corresponding device range
1184 |4084H|(((
1185 When the value specified in (s) and (s4) is not in the range of 0 to 23
1186
1187 When the value specified in (s2),(s3) (s4)+1 and (s4)+2 is not in the range of 0 to 59
1188 )))
1189
1190 **Example**
1191
1192 (% style="text-align:center" %)
1193 [[image:07-5 Basic instructions_html_fcc16317cf7c0700.png||height="68" width="359"]]
1194
1195 Set D10 to 1, D11 to 30, D12 to 0
1196
1197 When M0 is turned on, the time that D23 will come is 0:31:27
1198
1199 (% style="text-align:center" %)
1200 [[image:07-5 Basic instructions_html_de97dd7a612b2323.png||height="50" width="653"]]
1201
1202 M10 is turned ON
1203
1204 (% style="text-align:center" %)
1205 [[image:07-5 Basic instructions_html_56e2d606adc09fd.png||height="52" width="239"]]
1206
1207 == **TZCP/Clock data bandwidth comparison** ==
1208
1209 **TZCP(P)**
1210
1211 Compare the comparison time of the high and low points specified in (s1) and (s2) with the time data specified in (s3), and turn the bit device specified in (d) ON/OFF according to its size and bandwidth.
1212
1213 -[TZCP (s1) (s2) (s3) (d)]
1214
1215 **Content, range and data type**
1216
1217 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1218 |(s1)|Specify the "hour" of the lower limit time (hour, minute, second)|-|Signed BIN 16 bit|(((
1219 ANY16_ARRAY (number of elements: 3)
1220 )))
1221 |(s2)|Specify the "hour" of the lower limit time (hour, minute, second)|-|Signed BIN 16 bit|(((
1222 ANY16_ARRAY (number of elements: 3)
1223 )))
1224 |(s3)|Specify "hour" of time data (hour, minute, second)|-|Signed BIN 16 bit|(((
1225 ANY16_ARRAY (number of elements: 3)
1226 )))
1227 |(d)|The bit device is turned ON/OFF according to the comparison result.|-|Bit|(((
1228 ANY16_ARRAY (number of elements: 3)
1229 )))
1230
1231 **Device used**
1232
1233 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**|(((
1234 **Pulse extension**
1235 )))
1236 |**Y**|**M**|**S**|**SM**|**D.b**|**T**|**C**|**D**|**R**|**SD**|**[D]**|**XXP**
1237 |(% rowspan="4" %)TZCP|Parameter 1| | | | | |●|●|●|●|●|●|●
1238 |Parameter 2| | | | | |●|●|●|●|●|●|●
1239 |Parameter 3| | | | | |●|●|●|●|●|●|●
1240 |Parameter 4|●|●|●|●|●| | | | | |●|●
1241
1242 **Features**
1243
1244 Compare the comparison time of the high and low points specified in (s1) and (s2) with the time data specified in (s3), and turn the bit device specified in (d) ON/OFF according to its size and bandwidth.
1245
1246 (% style="text-align:center" %)
1247 [[image:07-5 Basic instructions_html_844291270080313d.png||height="339" width="750"]]
1248
1249 ✎**Note:**
1250
1251 • The devices specified in (s1), (s2), (s3), (d) occupy 3 points. Be careful not to overlap with the device used for machine control.
1252
1253 • When using the clock data time (hour, minute, second) of the built-in real-time clock of the CPU module, use the TRD(P) instruction to read the value of the special register and assign the word device to each operand.
1254
1255 • When (s1)> (s2), two of (d), (d)+1, (d)+2 are ON/OFF.
1256
1257 **Error code**
1258
1259 |**Error code**|**Content**
1260 |4085H|When reading the specified device range exceeds the corresponding device range
1261 |4086H|When writing the specified device range exceeds the corresponding device range
1262 |4084H|(((
1263 When the value specified in (s1), (s2) and (s3) is not in the range of 0 to 23
1264
1265 When the value specified in (s1)+1, (s2)+1, (s3)+1, (s1)+2, (s2)+2 and (s3)+2 is not in the range of 0 to 59
1266 )))
1267
1268 **Example**
1269
1270 (% style="text-align:center" %)
1271 [[image:07-5 Basic instructions_html_30027a2387c26c2e.png||height="46" width="439"]]
1272
1273 Set D0 time to 16:30:00 and D10 time to 4:30:0
1274
1275 (% style="text-align:center" %)
1276 [[image:07-5 Basic instructions_html_c64e0faf2af172f8.png||height="49" width="626"]]
1277
1278 (% style="text-align:center" %)
1279 [[image:07-5 Basic instructions_html_66e3a2eadeb2ecbb.png||height="50" width="625"]]
1280
1281 After the coil is turned on, the reading time to D20 time is 8:30:00
1282
1283 (% style="text-align:center" %)
1284 [[image:07-5 Basic instructions_html_75c44dad07eaf80a.png||height="49" width="625"]]
1285
1286 M0/M12 is ON
1287
1288 (% style="text-align:center" %)
1289 [[image:07-5 Basic instructions_html_f512f36261705953.png||height="48" width="218"]]
1290
1291 = **Data control instructions** =
1292
1293 == **BAND/BIN 16-bit data dead zone control** ==
1294
1295 **BAND(P)**
1296
1297 The input value (BIN 16-bit value) specified in (s3) controls the output value stored in the device specified in (d) according to the upper and lower limits of the dead zone specified in (s1) and (s2).
1298
1299 -[BAND (s1) (s2) (S3) (d)]
1300
1301 **Content, range and data type**
1302
1303 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1304 |(s1)|Lower limit of dead zone (no output zone)|-32,768 to +32,767|Signed BIN 16 bit|ANY16_S
1305 |(s2)|Upper limit of dead zone (no output zone)|-32,768 to +32,767|Signed BIN 16 bit|ANY16_S
1306 |(S3)|Input value controlled by dead zone control|-32768 to +32,767|Signed BIN 16 bit|ANY16_S
1307 |(D)|The start number of the device that stores the output value controlled by the dead zone control|-|Signed BIN 16 bit|ANY16_S
1308
1309 **Device used**
1310
1311 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="11" %)**Devices**|(((
1312 **Offset modification**
1313 )))|(((
1314 **Pulse extension**
1315 )))
1316 |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**K**|**H**|**[D]**|**XXP**
1317 |(% rowspan="4" %)BAND|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●|●
1318 |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|●|●
1319 |Parameter 3|●|●|●|●|●|●|●|●|●| | |●|●
1320 |Parameter 4| |●|●|●|●|●|●|●|●| | |●|●
1321
1322 **Features**
1323
1324 The input value (BIN 16-bit value) specified in (s3) controls the output value stored in the device specified in (d) according to the upper and lower limits of the dead zone specified in (s1) and (s2). The output value is controlled as follows.
1325
1326 |**Condition**|**The value stored in the output value**
1327 |When dead zone low limit (s1)> input value (s3)|Input value (s3)-Dead zone low limit (s1)
1328 |When dead zone high limit (s1) <input value (s3)|Input value (s3)- Dead zone high limit (s2)
1329 |When dead zone low limit (s1) ≤ input value (s3) ≤ dead zone low limit (s2)|0
1330
1331 (((
1332 •When the output value stored in (d) is a signed BIN 16-bit value, and the operation result exceeds the range of -32768 to 32767, the situation is shown in the following example.
1333
1334 For example, when (s1) is 10 and (s3) is -32768,
1335
1336 the output value = -32768-10=8000H-000AH=7FFFH=32758.
1337
1338 (% style="text-align:center" %)
1339 [[image:07-5 Basic instructions_html_6850e21a76b813c0.png||height="295" width="550"]]
1340 )))
1341
1342 **Error code**
1343
1344 |**Error code**|**Content**
1345 |4085H|When the specified device range for reading exceeds the range of the corresponding device.
1346 |4086H|When the specified device range for writing exceeds the range of the corresponding device.
1347 |4084H|When the low limit specified in (s1) is greater than the high limit specified in (s2).
1348
1349 **Example**
1350
1351 (% style="text-align:center" %)
1352 [[image:07-5 Basic instructions_html_c0e65cfeed403ecf.png||height="49" width="450"]]
1353
1354 When X000 is ON, when D0<(-1,000), the value of ( D0)-(-1,000) is stored in (D1).
1355
1356 • When -1,000≦ D0≦1,000, 0 is stored in D1.
1357
1358 • When D0<1,000, the value of (D0)-1,000 is stored in D1.
1359
1360 {{id name="_Toc1180"/}}{{id name="_Toc21657"/}}{{id name="_Toc27323"/}}[[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]]**DBAND/BIN 32-bit data dead zone control**
1361
1362 **DBAND(P)**
1363
1364 The input value (BIN 32-bit value) specified in (s3) controls the output value stored in the device specified in (d) according to the upper and lower limits of the dead zone specified in (s1) and (s2).
1365
1366 -[DBAND (s1) (s2) (S3) (d)]
1367
1368 **Content, range and data type**
1369
1370 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1371 |(s1)|Dead zone low limit (no output zone)|-2,147,483,648 to +2,147,483,647|Signed BIN 32 bit|ANY32_S
1372 |(s2)|Dead zone high limit (no output zone)|-2,147,483,648 to +2,147,483,647|Signed BIN 32 bit|ANY32_S
1373 |(S3)|Input value controlled by dead zone control|-2,147,483,648 to +2,147,483,647|Signed BIN 32 bit|ANY32_S
1374 |(d)|The start number of the device that stores the output value controlled by the dead zone control|-|Signed BIN 32 bit|ANY32_S
1375
1376 **Device used**
1377
1378 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
1379 **Pulse**
1380
1381 **extension**
1382 )))
1383 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1384 |(% rowspan="4" %)DBAND|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
1385 |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
1386 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●|●
1387 |Parameter 4| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|●
1388
1389 **Features**
1390
1391 The input value (BIN 32-bit value) specified in (s3) controls the output value stored in the device specified in (d) according to the upper and lower limits of the dead zone specified in (s1) and (s2). The output value is controlled as follows.
1392
1393 |**Condition**|**The value stored in the output value**
1394 |When dead zone low limit ((s1), (s1)+1)> input value ((s3), (s3)+1)|{{id name="OLE_LINK42"/}}Input value ((s3), (s3)+1)-dead zone low limit ((s1), (s1)+1)
1395 |When dead zone high limit ((s1), (s1)+1) <input value ((s3), (s3)+1)|{{id name="OLE_LINK357"/}}Input value ((s3), (s3)+1)-dead zone high limit ((s2), (s2)+1)
1396 |When dead zone low limit ((s1), (s1)+1) ≤ input value ((s3), (s3)+1) ≤ dead zone high limit ((s2), (s2)+1)|0
1397
1398
1399 (((
1400 • When the output value stored in (d) is a signed BIN 32-bit value, and the operation result exceeds the range of -2,147,483,648 to 2,147,483,647, the situation is as the following example. For example,** &nbsp;**When (s1) and (s1)+1 are 1000, (s3) and (s3)+1 are -2,147,483,648, then the output value=
1401
1402 -2,147,483,648-1000=80000000H-000003E8H=7FFFFC18H=2,147,482,648.
1403
1404 [[image:07-5 Basic instructions_html_e0144674dad3e8fd.png]]
1405
1406
1407
1408 )))
1409
1410 **Error code**
1411
1412 |**Error code**|**Content**
1413 |4085H|When the specified device range for reading exceeds the range of the corresponding device.
1414 |4086H|When the specified device range for writing exceeds the range of the corresponding device.
1415 |4084H|When the low limit specified in (s1) is greater than the high limit specified in (s2).
1416
1417 **Example**
1418
1419 [[image:07-5 Basic instructions_html_88f3fe0fb4841bab.png]]
1420
1421 • When (D1, D0)<(-10,000), the value of (D1, D0)-(-10,000) is stored in (D11, D10).
1422
1423 • When -10,000≦(D1, D0)≦10,000, 0 is stored in (D11, D10).
1424
1425 • When 10,000< (D1, D0), the value of (D1, D0)-10,000 is stored in D1.
1426
1427 {{id name="_Toc21668"/}}{{id name="_Toc25056"/}}{{id name="_Toc17582"/}}{{id name="OLE_LINK165"/}}**BINDA/BIN 16-bit data → Decimal ASCII conversion**
1428
1429 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **BINDA(P)**
1430
1431 Convert the BIN 16-bit data specified in (s) and the value of each digit in decimal numbers into ASCII codes and store them after the device number specified in (d).
1432
1433 -[BINDA(s)(d)]
1434
1435 **Content, range and data type**
1436
1437 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1438 |(s)|BIN data for ASCII conversion|-32768 to +32767|Signed BIN 16 bit|ANY16_S
1439 |(d)|The start number of the device storing the conversion result|-|String|ANYSTRING_SINGLE
1440
1441 **Device used**
1442
1443 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
1444 **Pulse**
1445
1446 **extension**
1447 )))
1448 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1449 |(% rowspan="2" %)BINDA|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
1450 |Parameter 2| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|●
1451
1452 **Features**
1453
1454 Convert the BIN 16-bit data specified in (s) and the value of each digit in decimal numbers into ASCII codes and store them after the device number specified in (d).
1455
1456
1457
1458 (((
1459 ←Only store 0 when SM191 is OFF
1460
1461 [[image:07-5 Basic instructions_html_57bda5f08026449d.png]]
1462 )))
1463
1464 For example, when -12,345 is specified in (s) (in the case of specifying signed)
1465
1466 [[image:07-5 Basic instructions_html_f346102467b9bef9.png]]
1467
1468 The calculation result stored in (d) will be as below.
1469
1470 • In "Sign", 20H is stored when the BIN data is positive, and 2DH is stored when it is negative.
1471
1472 • In the 0 to the left of the effective digit, 20H is stored. (Suppress 0.) For example, in the case of "00325", "00" becomes 20H, and "325" becomes the effective digit.
1473
1474 • When storing data to the device specified in (d)+3, when SM191 (output character number switching signal) is OFF, 0 is stored, and it does not change when it is ON.
1475
1476 ✎**Note: **The number of occupied points of (d) is 3 when SM191 is ON, and it is 4 when SM191 is OFF.
1477
1478 **Error code**
1479
1480 |**Error code**|**Content**
1481 |4085H|The read address of (s) exceeds the device range.
1482 |4086H|The write address of (d) exceeds the device range.
1483
1484 **Example**
1485
1486
1487
1488 (((
1489 When X000 is ON, convert the value of 16-bit data (BIN) D1000 into decimal ASCII code, and then use PR instruction to output the
1490
1491 converted ASCII code character by character to the program of Y040 to Y057.
1492
1493 [[image:07-5 Basic instructions_html_c598806a42484ed.png]]
1494 )))
1495
1496 {{id name="_Toc12255"/}}{{id name="_Toc8216"/}}{{id name="_Toc470"/}}**DBINDA/BIN 32-bit data → Decimal ASCII conversion**
1497
1498 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **DBINDA(P)**
1499
1500 Convert the BIN 32-bit data specified in (s) and the value of each bit in decimal numbers into ASCII codes and store them after the device number specified in (d).
1501
1502 -[DBINDA(s)(d)]
1503
1504 **Content, range and data type**
1505
1506 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1507 |(s)|BIN data for ASCII conversion|-2,147483648 to 2147483647|Signed BIN 32 bit|ANY32_S
1508 |(d)|{{id name="OLE_LINK2"/}}The start number of the device storing the conversion result|-|String|ANYSTRING_SINGLE
1509
1510 **Device used**
1511
1512 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|(((
1513 **Offset**
1514
1515 **modification**
1516 )))|(((
1517 **Pulse**
1518
1519 **extension**
1520 )))
1521 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1522 |(% rowspan="2" %)DBINDA|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
1523 |Parameter 2| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|●
1524
1525 **Features**
1526
1527 Convert the BIN 32-bit data specified in (s) and the value of each bit when expressed in decimal numbers into ASCII codes, and store them after the device number specified in (d).
1528
1529 For example, when -12345678 is specified in (s). (in the case of specifying signed)
1530
1531 [[image:07-5 Basic instructions_html_4d939462838cf09b.gif]] The calculation result stored in (d) will be as below.
1532
1533 • In "Sign", 20H is stored when the BIN data is positive, and 2DH is stored when it is negative.
1534
1535 • 20H is stored at 0 to the left of the effective number of digits. (Suppress 0.) For example, in the case of "0012034560", "00" becomes 20H, and "12034560" becomes effective digits.
1536
1537 • For the data stored in the upper 8 bits of the device specified in (d)+5, 0 will be stored when SM191 (output character switching signal) is OFF, and 20H will be stored when it is ON.
1538
1539 ✎**Note: **(d) Occupies 6 points.
1540
1541 **Error code**
1542
1543 |**Error code**|**Content**
1544 |4085H|(s) read address exceeds the device range
1545 |4086H|(d) write address exceeds the device range
1546
1547 **Example**
1548
1549 [[image:07-5 Basic instructions_html_ec8ac32d748a991c.png]]
1550
1551 When X000 is ON, convert the value of 32-bit data (BIN) D1000 into decimal ASCII code, and then use PR (FNC 77) instruction to output the converted ASCII code character by character to the program in Y040 to Y051 in time and time division.
1552
1553 {{id name="_Toc19693"/}}{{id name="_Toc18078"/}}{{id name="_Toc5726"/}}**DABIN/Decimal ASCII → BIN conversion**
1554
1555 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **DABIN(P)**
1556
1557 Digital ASCII code (30H to 39H) is a instruction to convert real data into BIN data.
1558
1559 -[DABIN (s) (d)]
1560
1561 **Content, range and data type**
1562
1563 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1564 |(s)|The start number of the device that stores the data (ASCII code) to be converted into a BIN value|-|String|ANYSTRING_SINGLE
1565 |(d)|The device number for storing conversion result|-|BIN16 bit|ANY16_S
1566
1567 **Device used**
1568
1569 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
1570 **Pulse**
1571
1572 **extension**
1573 )))
1574 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1575 |(% rowspan="2" %)DABIN|Parameter 1| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|●
1576 |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
1577
1578 **Features**
1579
1580 The decimal ASCII data stored after the device number specified in (s) is converted into BIN 16-bit data and stored in the device specified in (d).
1581
1582 [[image:07-5 Basic instructions_html_22c5cb32a0a32214.png]]
1583
1584 |**ASCII S**|**ASCII 10^^0^^**|**ASCII 10^^1^^**|**ASCII 10^^2^^**|**ASCII 10^^3^^**|**ASCII 10^^4^^**
1585 |**ASCII code**|(((
1586 {{id name="OLE_LINK36"/}}Units of
1587
1588 ASCII code
1589 )))|(((
1590 Tens of
1591
1592 ASCII code
1593 )))|(((
1594 Hundreds of
1595
1596 ASCII code
1597 )))|(((
1598 Thousands of
1599
1600 ASCII code
1601 )))|(((
1602 Ten thousands
1603
1604 of ASCII code
1605 )))
1606
1607 For example, When -25,108 is specified in (s)
1608
1609 [[image:07-5 Basic instructions_html_10fb2792e37dbf23.png]]
1610
1611 • The ASCII data specified in (s) to (s)+2 is within the range of -32,768 to +32,767.
1612
1613 • In “Sign”, set 20H when the converted data is positive, and set 2DH when it is negative. (When other than 20H or 2DH is set, it will be treated as positive data. (DABIN(P))
1614
1615 • The range of the ASCII code set in each digit is 30H to 39H.
1616
1617 • When the ASCII code set in each bit is 20H or 00H, it will be treated as 30H.
1618
1619 **Error code**
1620
1621 |**Error code**|**Content**
1622 |4084H|(((
1623 When the Sign data exceeds the range of 30H to 39H, 20H, 00H, 2DH;
1624
1625 When the ASCII code of each bit specified in (s) to (s)+2 exceeds the range of 30H to 39H, 20H, 00H;
1626
1627 When the ASCII data specified in (s) to (s)+2 is other than -32,768 to +32,767.
1628 )))
1629 |4085H|The read address of (s) exceeds the device range.
1630 |4086H|The write address of (d) exceeds the device range.
1631
1632
1633 (((
1634 When X000 is ON, the Signs set in D20 to D22 and the ASCII code data of 5-digit decimal numbers are converted into BIN values, and then stored in the program of D0.
1635
1636 **Example**
1637 )))
1638
1639 [[image:07-5 Basic instructions_html_bec2bea131b58c03.png]]
1640
1641 {{id name="_Toc3351"/}}{{id name="_Toc26383"/}}{{id name="_Toc26233"/}}**DDABIN/Decimal ASCII → BIN32-bit data conversion**
1642
1643 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **DDABIN(P)**
1644
1645 The decimal ASCII data stored after the device number specified in (s) is converted into BIN 32-bit data and stored in the device number specified in (d).
1646
1647 -[DDABIN (s) (d) ]
1648
1649 **Content, range and data type**
1650
1651 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1652 |(s)|The start number of the device that stores data (ASCII code) to be converted into a BIN value|-|String|ANYSTRING_SINGLE
1653 |(d)|The device number for storing conversion result|-|Signed BIN 32 bit|ANY32_S
1654
1655 **Device used**
1656
1657 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
1658 **Pulse**
1659
1660 **extension**
1661 )))
1662 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1663 |(% rowspan="2" %)DDABIN|Parameter 1| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|●
1664 |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|●
1665
1666 **Features**
1667
1668 The decimal ASCII data stored after the device number specified in (s) is converted into BIN 32-bit data and stored in the device specified in (d).
1669
1670 [[image:07-5 Basic instructions_html_c444110b273f33b7.gif]]
1671
1672 |**ASCII S**|**ASCII code**|**ASCII S**|**ASCII code**
1673 |ASCII 10^^0^^|Units of ASCII code|ASCII 10^^5^^|{{id name="OLE_LINK38"/}}Hundred thousands of ASCII code
1674 |ASCII 10^^1^^|Tens of ASCII code|ASCII 10^^6^^|Millions of ASCII code
1675 |ASCII 10^^2^^|Hundreds of ASCII code|ASCII 10^^7^^|Ten millions of ASCII code
1676 |ASCII 10^^3^^|{{id name="OLE_LINK37"/}}Thousands of ASCII code|ASCII 10^^8^^|Hundred millions of ASCII code
1677 |ASCII 10^^4^^|Tens thousands of ASCII code|ASCII 10^^9^^|billions of ASCII code
1678
1679 When -1234543210 is specified in (s) (When signed is specified)
1680
1681 [[image:07-5 Basic instructions_html_1b4c7e1c663a4399.png]]
1682
1683 • The ASCII data specified in (s) to (s)+5 is within the range of -2,147,483,648 to +2,147,483,647. In addition, the data stored in the high byte of (s)+5 will be ignored.
1684
1685 • In the Sign data, set 20H when the converted data is positive, and set 2DH when it is negative. (When other than 20H or 2DH is set, it will be treated as positive data. (DABIN(P))
1686
1687 • The range of ASCII code set in each digit is 30H to 39H.
1688
1689 • When the ASCII code set in each bit is 20H or 00H, it will be treated as 30H.
1690
1691 **Error code**
1692
1693 |**Error code**|**Content**
1694 |4084H|(((
1695 When the Sign data exceeds the range of 30H to 39H, 20H, 00H and 2DH;
1696
1697 {{id name="OLE_LINK39"/}}When the ASCII code of each bit specified in (s) to (s)+5 exceeds the range of 30H to 39H, 20H and 00H;
1698
1699 When the ASCII data specified in (s) to (s)+5 exceeds the range of -2,147,483,648 to +2,147,483,647
1700 )))
1701 |4085H|The read address of (s) exceeds the device range.
1702 |4086H|The write address of (d) exceeds the device range.
1703
1704 **Example**
1705
1706 [[image:07-5 Basic instructions_html_feea438c943ea9dd.png]]
1707
1708 When X000 is ON, the Signs set in to D20 to D25 and the ASCII code data of 10-digit decimal numbers are converted into BIN values and then saved to the program in D0 to D1.
1709
1710 {{id name="_Toc26556"/}}{{id name="_Toc12799"/}}{{id name="_Toc23863"/}}**LIMIT/ BIN 16-bit data high and low limit control**
1711
1712 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **LIMIT(P)**
1713
1714 The input value (BIN 16-bit value) specified in (s3) controls the output value stored in the device specified in (d) according to the upper and lower limit value ranges specified in (s1) and (s2).
1715
1716 -[LIMIT (s1) (s2) (s3) (d)]
1717
1718 **Content, range and data type**
1719
1720 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1721 |s1|Low limit value (minimum output limit value)|-32,768 to 32,767|BIN16 bit|ANY16_S
1722 |s2|High limit value (maximum output limit value)|-32,768 to 32,767|BIN16 bit|ANY16_S
1723 |s3|Input value controlled by high and low limit control|-32,768 to 32,767|BIN16 bit|ANY16_S
1724 |d|The start number of device that stores the output value controlled by high and low limit control|-|BIN16 bit|ANY16_S
1725
1726 **Device used**
1727
1728 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
1729 **Pulse**
1730
1731 **extension**
1732 )))
1733 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1734 |(% rowspan="4" %)LIMIT|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
1735 |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
1736 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|●
1737 |Parameter 4| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
1738
1739 **Features**
1740
1741 The input value (BIN 16-bit value) specified in (s3) controls the output value stored in the device specified in (d) according to the high and low limit value ranges specified in (s1) and (s2). The output value is controlled as follows.
1742
1743 |**Condition**|**The value stored in the output value**
1744 |Low limit value (s1)>input value (s3)|Low limit value (s1)
1745 |High limit value (s1) <input value (s3)|High limit value (s2)
1746 |Low limit value (s1) ≤ input value (s3) ≤ high limit value (s2)|Input value (s3)
1747
1748
1749 (((
1750 •Only in the case of controlling high limit value, set the minimum value of data range in the low limit value specified in (s1).
1751
1752 • Only in the case of controlling low limit value, set the maximum value of data range in the high limit value specified in (s2).
1753
1754 [[image:07-5 Basic instructions_html_50eb5229b027aa14.png]]
1755 )))
1756
1757 **Error code**
1758
1759 |**Error code**|**Content**
1760 |4085H|The read address exceeds the device range
1761 |4086H|The write address exceeds the device range
1762 |4084H|High limit <low limit
1763
1764 **Example**
1765
1766 [[image:07-5 Basic instructions_html_d67a2e740d4fc738.png]]
1767
1768 When X000 is ON
1769
1770 • When D0 <500, D1 is 500.
1771
1772 • When 500 ≤ D0 ≤ 5,000, D1 is the value of D0.
1773
1774 • When 5,000 <D0, D1 is 5,000.
1775
1776 {{id name="_Toc32553"/}}{{id name="_Toc9981"/}}{{id name="_Toc9158"/}}**DLIMIT/BIN 32-bit data high and low limit control**
1777
1778 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **DLIMIT(P)**
1779
1780 The input value (BIN 32-bit value) specified in (s3) controls the output value stored in the device specified in (d) according to the range of high and low limit values specified in (s1) and (s2).
1781
1782 -[DLIMIT (s1) (s2) (s3) (d)]
1783
1784 **Content, range and data type**
1785
1786 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1787 |s1|Low limit value (minimum output limit value)|-2,147,483,648 to 2,147,483,647|BIN32 bit|ANY32_S
1788 |s2|High limit value (maximum output limit value)|-2,147,483,648 to 2,147,483,647|BIN32 bit|ANY32_S
1789 |s3|Input value controlled by high and low limit control|-2,147,483,648 to 2,147,483,647|BIN32 bit|ANY32_S
1790 |d|The start number of the device that stores the output value controlled by high and low limit control|-|BIN32 bit|ANY32_S
1791
1792 **Device used**
1793
1794 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
1795 **Pulse**
1796
1797 **extension**
1798 )))
1799 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1800 |(% rowspan="4" %)DLIMIT|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
1801 |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
1802 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●|●
1803 |Parameter 4| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|●
1804
1805 **Features**
1806
1807 The input value (BIN 32-bit value) specified in (s3) controls the output value stored in the device specified in (d) according to the range of high and low limit values specified in (s1) and (s2). The output value is controlled as follows.
1808
1809 |**Condition**|**The value stored in the output value**
1810 |Low limit value ((s1), (s1)+1)> input value ((s3), (s3)+1)|Low limit value ((s1), (s1)+1)
1811 |High limit value ((s2), (s2)+1) <input value ((s3), (s3)+1)|High limit value ((s2), (s2)+1)
1812 |Low limit value ((s1), (s1)+1) ≤ input value ((s3), (s3)+1) ≤ high limit value ((s2), (s2)+1)|Input value ((s3), (s3)+1)
1813
1814 {{id name="OLE_LINK43"/}}{{id name="OLE_LINK40"/}}•Only in the case of controlling high limit value, set the minimum value of data range in the low limit value specified in (s1).
1815
1816 • Only in the case of controlling low limit value, set the maximum value of data range in the high limit value specified in (s2).
1817
1818 **Error code**
1819
1820 |**Error code**|**Content**
1821 |4085H|The read address exceeds the device range
1822 |4086H|The write address exceeds the device range
1823 |4084H|High limit <low limit
1824
1825 **Example**
1826
1827 [[image:07-5 Basic instructions_html_217355b90f4b4e16.png]]
1828
1829 Operation:
1830
1831 • When (D1, D0) <10,000, (D11, D10) is 10,000.
1832
1833 • When 10,000 ≤ (D1, D0) ≤ 1,000,000, (D11, D10) is the value of (D1, D0).
1834
1835 • When 1,000,000 <(D1, D0), (D11, D10) is 1,000,000.
1836
1837 {{id name="_Toc12534"/}}{{id name="_Toc28213"/}}{{id name="_Toc24591"/}}**SCL/BIN 16-bit unit scale (coordinate data of each point)**
1838
1839 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **SCL(P)**
1840
1841 The scaling conversion data (16-bit data unit) specified in (s2) is scaled from the input value specified in (s1), and the calculation result is stored in the device specified in (d).
1842
1843 -[SCL (s1) (s2) (d)]
1844
1845 **Content, range and data type**
1846
1847 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1848 |(s1)|The input value for scaling or the start number of device storing the input value|-32,768 to 32,767|Signed BIN 16 bit|ANY16_S
1849 |(s2)|The start number of the device storing conversion data for scaling|-|Signed BIN 16 bit|ANY16_S
1850 |(d)|The start number of the device that stores the output value controlled by scaling|-|Signed BIN 16 bit|ANY16_S
1851
1852 **Device used**
1853
1854 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
1855 **Pulse**
1856
1857 **extension**
1858 )))
1859 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1860 |(% rowspan="3" %)SCL|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
1861 |Parameter 2| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|●
1862 |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
1863
1864 **Features**
1865
1866 For the scale conversion data (16-bit data unit) specified in (s2), scale by the input value specified in (s1), and store the operation result in the device specified in (d). Scale conversion is performed based on the scale conversion data stored after the device specified in (s2).
1867
1868 |(% colspan="2" %)**Setting items (n represents the number of coordinate points specified in (s2))**|**Device allocation**
1869 |(% colspan="2" %)Coordinate points|(s2)
1870 |(% rowspan="2" %)Point 1|X coordinate|(s2)+1
1871 |Y coordinate|(s2)+2
1872 |(% rowspan="2" %)Point 2|X coordinate|(s2)+3
1873 |Y coordinate|(s2)+4
1874 |(% colspan="3" %)........
1875 |(% rowspan="2" %)Point n|X coordinate|(s2)+2n-1
1876 |Y coordinate|(s2)+2n
1877
1878 [[image:07-5 Basic instructions_html_80185ccddb878234.png]]
1879
1880 • If the operation result is not an integer value, round the first digit below the decimal point.
1881
1882 • The X coordinate data of the conversion data for scaling should be set in ascending order.
1883
1884 • (s1) should be set within the range of conversion data for scaling (device value of (s2)).
1885
1886 • If the same X coordinate is specified for multiple points, the Y coordinate value of the second point will be output.
1887
1888 • Set the number of coordinate points of the conversion data for scaling within the range of 1 to 32,767.
1889
1890 • Setting example of conversion table for scaling.
1891
1892 In the case of scaling conversion characteristics as shown in the figure below, set it as the following data sheet.
1893
1894 [[image:07-5 Basic instructions_html_74fd22d845ad450e.png]]
1895
1896 |(% colspan="2" rowspan="2" %)**Set &nbsp;&nbsp;&nbsp;&nbsp;items**|(% colspan="3" %)**Sett &nbsp;&nbsp;&nbsp;&nbsp;device and content**|(% rowspan="2" %)**Remarks**
1897 |(% colspan="2" %)**When R0 is specified in (s2)**|**Set &nbsp;&nbsp;&nbsp;&nbsp;content**
1898 |(% colspan="2" %)Coordinate points|(s2)|R0|K10|
1899 |(% rowspan="2" %)Point 1|X coordinate|(s2)+1|R1|K5|
1900 |Y coordinate|(s2)+2|R2|K20|
1901 |(% rowspan="2" %)Point 2|X coordinate|(s2)+3|R3|K30|
1902 |Y coordinate|(s2)+4|R4|K50|
1903 |(% rowspan="2" %)Point 3|X coordinate|(s2)+5|R5|K100|
1904 |Y coordinate|(s2)+6|R6|K200|
1905 |(% rowspan="2" %)Point 4|X coordinate|(s2)+7|R7|K25|(% rowspan="6" %)(((
1906 If the coordinates are specified by 3 points, the intermediate value could be the output value.
1907
1908 In this example, the output value (median value) is specified by the Y coordinate of point 5.
1909
1910 When the X coordinate is the same at 3 points or more, the value of the 2nd point is also output.
1911 )))
1912 |Y coordinate|(s2)+8|R8|K200
1913 |(% rowspan="2" %)Point 5|X coordinate|(s2)+9|R9|K70
1914 |Y coordinate|(s2)+10|R10|K200
1915 |(% rowspan="2" %)Point 6|X coordinate|(s2)+11|R11|K250
1916 |Y coordinate|(s2)+12|R12|K250
1917 |(% rowspan="2" %)Point 7|X coordinate|(s2)+13|R13|K250|
1918 |Y coordinate|(s2)+14|R14|K90|
1919 |(% rowspan="2" %)Point 8|X coordinate|(s2)+15|R15|K350|(% rowspan="4" %)(((
1920 If the coordinates are specified by two points, the output value is the value of the Y coordinate of the next point.
1921
1922 In this example, the output value is specified by the Y coordinate of point 9.
1923 )))
1924 |Y coordinate|(s2)+16|R16|K90
1925 |(% rowspan="2" %)Point 9|X coordinate|(s2)+17|R17|K350
1926 |Y coordinate|(s2)+18|R18|K30
1927 |(% rowspan="2" %)Point 10|X coordinate|(s2)+19|R19|K400|
1928 |Y coordinate|(s2)+20|R20|K7|
1929
1930 **Error code**
1931
1932 |**Error code**|**Content**
1933 |4085H|When the specified device range for reading exceeds the range of the corresponding device.
1934 |4086H|When the specified device range for writing exceeds the range of the corresponding device.
1935 |4084H|(((
1936 When the Xn data of data table is not sorted in ascending order. However, the instruction will be executed until the position where the error occurs;
1937
1938 When the input value specified in (s1) exceeds the range of the set scale conversion data;
1939
1940 When the number of start coordinate points of device (s2) is less than 0.
1941 )))
1942
1943 **Example**
1944
1945 [[image:07-5 Basic instructions_html_5519d7b41f15b6d6.png]]
1946
1947 [[image:07-5 Basic instructions_html_ace075fb7675de8e.gif]] When -100 ≤ D0(X) < 0, D100(Y)=
1948
1949 [[image:07-5 Basic instructions_html_9acd6306c6d91847.gif]] when D0(X)=0, D100(Y)=0;
1950
1951 when 0< D0(X) ≤ 100, D100(Y)=
1952
1953 [[image:07-5 Basic instructions_html_e35e13160c08a133.png]]
1954
1955
1956
1957 {{id name="_Toc4862"/}}{{id name="_Toc11340"/}}{{id name="_Toc25383"/}}**DSCL/32-bit unit scale (coordinate data of each point)**
1958
1959 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **DSCL(P)**
1960
1961 The conversion data (32-bit data unit) for scaling specified in (s2) is scaled by the input value specified in (s1), and the operation result is stored in the device specified in (d).
1962
1963 -[DSCL (s1) (s2) (d)]
1964
1965 **Content, range and data type**
1966
1967 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
1968 |(s1)|The input value for scaling or the start number of the device storing the input value|-2,147,483,648 to 2,147,483,647|Signed BIN 32 bit|ANY32_S
1969 |(s2)|The start number of the device storing conversion data for scaling|-|Signed BIN 32 bit|ANY32_S
1970 |(d)|The start number of the device that stores the output value controlled by scaling|-|Signed BIN 32 bit|ANY32_S
1971
1972 **Device used**
1973
1974 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Device**|**Offset modification**|(((
1975 **Pulse**
1976
1977 **extension**
1978 )))
1979 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
1980 |(% rowspan="3" %)DSCL|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
1981 |Parameter 2| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|●
1982 |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|●
1983
1984 **Features**
1985
1986 {{id name="OLE_LINK41"/}}The conversion data (32-bit data unit) for scaling specified in (s2) is scaled by the input value specified in (s1), and the operation result is stored in the device number specified in (d). The scale conversion is performed based on the scale conversion data stored after the device specified in (s2).
1987
1988 |(% colspan="2" %)**Set items (n represents the number of coordinate points specified in (s2))**|**Device allocation**
1989 |(% colspan="2" %)Coordinate points|(s2)+1, (s2)
1990 |(% rowspan="2" %)Point 1|X coordinate|(s2)+3, (s2)+2
1991 |Y coordinate|(s2)+5, (s2)+4
1992 |(% rowspan="2" %)Point 2|X coordinate|(s2)+7, (s2)+6
1993 |Y coordinate|(s2)+9, (s2)+8
1994 |(% colspan="3" %)........
1995 |(% rowspan="2" %)Point n|X coordinate|(s2)+4n-1, (s2)+4n-2
1996 |Y coordinate|(s2)+4n+1, (s2)+4n
1997
1998 [[image:07-5 Basic instructions_html_6633ca18cee1218c.png]]
1999
2000 • If the calculation result is not an integer value, round the first digit below the decimal point.
2001
2002 • The X coordinate data of the conversion data for scaling should be set in ascending order.
2003
2004 • For (s1), set within the range of the conversion data for scaling ((s2), (s2) + 1 device value).
2005
2006 • If the same X coordinate is specified for multiple points, the Y coordinate value of the second point will be output.
2007
2008 • Set the number of coordinate points of conversion data for scaling within the range of 1 to 2,147,483,647.
2009
2010 • Setting example of conversion table for scaling.
2011
2012 In the case of scaling conversion characteristics as shown in the figure below, set it as the following data sheet.
2013
2014 [[image:07-5 Basic instructions_html_74fd22d845ad450e.png]]
2015
2016 |(% colspan="2" rowspan="2" %)**Set items**|(% colspan="3" %)**Set &nbsp;&nbsp;&nbsp;&nbsp;device and content**|(% rowspan="2" %)**Remarks**
2017 |(% colspan="2" %)**When R0 is specified in (s2)**|**Set &nbsp;&nbsp;&nbsp;&nbsp;content**
2018 |(% colspan="2" %)Coordinate points|(s2)+1, (s2)|R1, R0|K10|
2019 |(% rowspan="2" %)Point 1|X coordinate|(s2)+3, (s2)+2|R3, R2|K5|
2020 |Y coordinate|(s2)+5, (s2)+4|R5, R4|K7|
2021 |(% rowspan="2" %)Point 2|X coordinate|(s2)+7, (s2)+6|R7, R6|K20|
2022 |Y coordinate|(s2)+9, (s2)+8|R9, R8|K30|
2023 |(% rowspan="2" %)Point 3|X coordinate|(s2)+11, (s2)+10|R10, R11|K50|
2024 |Y coordinate|(s2)+13, (s2)+12|R13, R12|K100|
2025 |(% rowspan="2" %)Point 4|X coordinate|(s2)+15, (s2)+14|R15, R14|K200|(% rowspan="6" %)(((
2026 if the coordinates are specified by 3 points, the intermediate value could be the output value.
2027
2028 In this example, the output value (median value) is specified by the Y coordinate of point 5.
2029
2030 When the X coordinate is the same at 3 points or more, the value of the 2nd point is also output.
2031 )))
2032 |Y coordinate|(s2)+17, (s2)+16|R17, R16|K25
2033 |(% rowspan="2" %)Point 5|X coordinate|(s2)+19, (s2)+18|R19, R18|K200
2034 |Y coordinate|(s2)+21, (s2)+20|R21, R20|K70
2035 |(% rowspan="2" %)Point 6|X coordinate|(s2)+23, (s2)+22|R23, R22|K200
2036 |Y coordinate|(s2)+25, (s2)+24|R25, R24|K250
2037 |(% rowspan="2" %)Point 7|X coordinate|(s2)+27, (s2)+26|R27, R26|K250|
2038 |Y coordinate|(s2)+29, (s2)+28|R29, R28|K90|
2039 |(% rowspan="2" %)Point 8|X coordinate|(s2)+31, (s2)+30|R31, R30|K350|(% rowspan="4" %)(((
2040 If the coordinates are specified by two points, the output value is the value of the Y coordinate of the next point.
2041
2042 In this example, the output value is specified by the Y coordinate of point 9.
2043 )))
2044 |Y coordinate|(s2)+33, (s2)+32|R33, R32|K90
2045 |(% rowspan="2" %)Point 9|X coordinate|(s2)+35, (s2)+34|R35, R34|K350
2046 |Y coordinate|(s2)+37, (s2)+36|R37, R36|K30
2047 |(% rowspan="2" %)Point 10|X coordinate|(s2)+39, (s2)+38|R39, R38|K400|
2048 |Y coordinate|(s2)+41, (s2)+40|R41, R40|K7|
2049
2050 **Error code**
2051
2052 |**Error code**|**Content**
2053 |4085H|When the specified device range for reading exceeds the range of the corresponding device.
2054 |4086H|When the specified device range for writing exceeds the range of the corresponding device.
2055 |4084H|(((
2056 When the Xn data of data table is not sorted in ascending order. However, the instruction will be executed until the position where the error occurs;
2057
2058 When the input value specified in (s1) exceeds the range of the set scale conversion data;
2059
2060 When the number of start coordinate points of device (s2) is less than 0.
2061 )))
2062
2063 **Example**
2064
2065 [[image:07-5 Basic instructions_html_ba95b2d50d8d1d3e.png]]
2066
2067 [[image:07-5 Basic instructions_html_1de79c7d87d51f78.gif]] When -100 ≤ D0(X) < 0, D100(Y)=
2068
2069 [[image:07-5 Basic instructions_html_9acd6306c6d91847.gif]] When D0(X)=0, D100(Y)=0;
2070
2071 When 0 < D0(X) ≤ 100, D100(Y)=
2072
2073 [[image:07-5 Basic instructions_html_a5b19d1af74a9620.png]]
2074
2075 {{id name="_Toc3776"/}}{{id name="_Toc11170"/}}{{id name="_Toc2957"/}}**SCL2/BIN 16-bit unit scale (X/Y coordinate data)**
2076
2077 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **SCL2(P)**
2078
2079 The conversion data (16-bit data unit) for scaling specified in (s2) is scaled by the input value specified in (s1), and the operation result is stored in the device specified in (d).
2080
2081 -[SCL2 (s1) (s2) (d)]
2082
2083 **Content, range and data type**
2084
2085 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
2086 |(s1)|The input value for scaling or the start number of the device storing the input value|-32,768 to 32,767|Signed BIN 16 bit|ANY16_S
2087 |(s2)|The start number of the device storing conversion data for scaling|-|Signed BIN 16 bit|ANY16_S
2088 |(d)|The start number of the device that stores the output value controlled by scaling|-|Signed BIN 16 bit|ANY16_S
2089
2090 **Device used**
2091
2092 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
2093 **Pulse**
2094
2095 **extension**
2096 )))
2097 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
2098 |(% rowspan="3" %)SCL2|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
2099 |Parameter 2| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|●
2100 |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
2101
2102 **Features**
2103
2104 The conversion data (16-bit data unit) for scaling specified in (s2) is scaled by the input value specified in (s1), and the operation result is stored in the device number specified in (d). The scale conversion is performed based on the scale conversion data stored after the device specified in (s2).
2105
2106 |(% colspan="2" %)**Set items (n represents the number of coordinate points specified in (s2))**|**Device allocation**
2107 |(% colspan="2" %)Coordinate points|(s2)
2108 |(% rowspan="4" %)X coordinate|Point 1|(s2)+1
2109 |Point 2|(s2)+2
2110 |.....|......
2111 |Point n|(s2)+n
2112 |(% rowspan="4" %)Y coordinate|Point 1|(s2)+n+1
2113 |Point 2|(s2)+n+2
2114 |.....|.....
2115 |Point n|(s2)+2n
2116
2117 [[image:07-5 Basic instructions_html_80185ccddb878234.png]]
2118
2119 • If the operation result is not an integer value, round the first digit below the decimal point.
2120
2121 • The X coordinate data of the conversion data for scaling should be set in ascending order.
2122
2123 • For (s1), set within the range of the conversion data for scaling ((s2), (s2) + 1 device value).
2124
2125 • If the same X coordinate is specified for multiple points, the Y coordinate value of the second point will be output.
2126
2127 • Set the number of coordinate points of conversion data for scaling within the range of 1 to 32,767.
2128
2129 • Setting example of conversion table for scaling.
2130
2131 In the case of scaling conversion characteristics as shown in the figure below, set it as the following data sheet.
2132
2133 [[image:07-5 Basic instructions_html_74fd22d845ad450e.png]]
2134
2135 |(% colspan="2" rowspan="2" %)**Set items**|(% colspan="3" %)**Set device and content**|(% rowspan="2" %)**Remarks**
2136 |(% colspan="2" %)**When R0 is specified in (s2)**|**Set content**
2137 |(% colspan="2" %)Coordinate points|(s2)|R0|K10|
2138 |(% rowspan="10" %)X coordinate|Point 1|(s2)+1|R1|K5|
2139 |Point 2|(s2)+2|R2|K20|
2140 |Point 3|(s2)+3|R3|K50|
2141 |Point 4|(s2)+4|R4|K200|(% rowspan="3" %)Refer to** ✎1**
2142 |Point 5|(s2)+5|R5|K200
2143 |Point 6|(s2)+6|R6|K200
2144 |Point 7|(s2)+7|R7|K250|
2145 |Point 8|(s2)+8|R8|K350|(% rowspan="2" %)Refer to** ✎2**
2146 |Point 9|(s2)+9|R9|K350
2147 |Point 10|(s2)+10|R10|K400|
2148 |(% rowspan="10" %)Y coordinate|Point 1|(s2)+11|R11|K7|
2149 |Point 2|(s2)+12|R12|K30|
2150 |Point 3|(s2)+13|R13|K100|
2151 |Point 4|(s2)+14|R14|K25|(% rowspan="3" %)Refer to**✎1**
2152 |Point 5|(s2)+15|R15|K70
2153 |Point 6|(s2)+16|R16|K250
2154 |Point 7|(s2)+17|R17|K90|
2155 |Point 8|(s2)+18|R18|K90|(% rowspan="2" %)Refer to** ✎2**
2156 |Point 9|(s2)+19|R19|K30
2157 |Point 10|(s2)+20|R20|K7|
2158
2159 ✎**1** Like points 4, 5, and 6, if the coordinates are specified by 3 points, the intermediate value could be the output value.
2160
2161 In this example, the output value (median value) is specified by the Y coordinate of point 5.
2162
2163 When the X coordinate is the same at 3 or more points, the value of the second point is also output.
2164
2165 ✎**2** Like points 8 and 9, if the coordinates are specified by 2 points, the output value is the value of the Y coordinate of next point.
2166
2167 In this example, the output value is specified by the Y coordinate of point 9.
2168
2169 **Error code**
2170
2171 |**Error code**|**Content**
2172 |4085H|When the specified device range for reading exceeds the range of the corresponding device.
2173 |4086H|When the specified device range for writing exceeds the range of the corresponding device.
2174 |4084H|(((
2175 When the Xn data of data table is not sorted in ascending order. However, the instruction will be executed until the position where the error occurs;
2176
2177 When the input value specified in (s1) exceeds the range of the set scale conversion data;
2178
2179 When the number of start coordinate points of device (s2) is less than 0.
2180 )))
2181
2182 **Example**
2183
2184 [[image:07-5 Basic instructions_html_ace075fb7675de8e.gif]] [[image:07-5 Basic instructions_html_de529c9a16a62ef0.png]]
2185
2186 When -100 ≤D0 (X) < 0, D100(Y)=
2187
2188 [[image:07-5 Basic instructions_html_9acd6306c6d91847.gif]] when D0(X)=0, D100(Y)=0;
2189
2190 when 0 < D0(X) ≤ 100, D100(Y)=
2191
2192 [[image:07-5 Basic instructions_html_a5b19d1af74a9620.png]]
2193
2194 {{id name="_Toc5608"/}}{{id name="_Toc1756"/}}{{id name="_Toc21402"/}}**DSCL2/BIN 32-bit unit scale (X/Y coordinate data)**
2195
2196 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **DSCL2(P)**
2197
2198 The conversion data (32-bit data unit) for scaling specified in (s2) is scaled by the input value specified in (s1), and the operation result is stored in the device specified in (d).
2199
2200 -[DSCL2 (s1) (s2) (d)]
2201
2202 **Content, range and data type**
2203
2204 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
2205 |(s1)|The input value for scaling or the start number of the device storing the input value|-2,147,483,648 to +2,147,483,647|Signed BIN 32 bit|ANY32_S
2206 |(s2)|The start number of the device storing conversion data for scaling|-|Signed BIN 32 bit|ANY32_S
2207 |(d)|The start number of the device that stores the output value controlled by scaling|-|Signed BIN 32 bit|ANY32_S
2208
2209 **Device used**
2210
2211 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
2212 **Pulse**
2213
2214 **extension**
2215 )))
2216 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
2217 |(% rowspan="3" %)DSCL2|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
2218 |Parameter 2| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|●
2219 |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|●
2220
2221 **Features**
2222
2223 The conversion data (32-bit data unit) for scaling specified in (s2) is scaled by the input value specified in (s1), and the operation result is stored in the device number specified in (d). The scale conversion is performed based on the scale conversion data stored after the device specified in (s2).
2224
2225 |(% colspan="2" %)**Set items (n represents the number of coordinate points specified in (s2))**|**Device allocation**
2226 |(% colspan="2" %)Coordinate points|(s2)+1, (s2)
2227 |(% rowspan="4" %)X coordinate|Point 1|(s2)+3, (s2)+2
2228 |Point 2|(s2)+5, (s2)+4
2229 |.....|......
2230 |Point n|(s2)+2n+1, (s2)+2n
2231 |(% rowspan="4" %)Y coordinate|Point 1|(s2)+2n+3, (s2)+2n+2
2232 |Point 2|(s2)+2n+5, (s2)+2n+4
2233 |.....|.....
2234 |Point n|(s2)+4n+1, (s2)+4n
2235
2236 [[image:07-5 Basic instructions_html_6633ca18cee1218c.png]]
2237
2238 • If the operation result is not an integer value, round the first digit below the decimal point.
2239
2240 • The X coordinate data of the conversion data for scaling should be set in ascending order.
2241
2242 • For (s1), set within the range of the conversion data for scaling ((s2), (s2) + 1 device value).
2243
2244 • If the same X coordinate is specified for multiple points, the Y coordinate value of the second point will be output.
2245
2246 • Set the number of coordinate points of conversion data for scaling within the range of 1 to 2,147,483,647.
2247
2248 • Setting example of conversion table for scaling.
2249
2250 In the case of scaling conversion characteristics as shown in the figure below, set it as the following data sheet.
2251
2252 [[image:07-5 Basic instructions_html_74fd22d845ad450e.png]]
2253
2254 |(% colspan="2" rowspan="2" %)**Set &nbsp;&nbsp;&nbsp;&nbsp;items**|(% colspan="3" %)**Set device and content**|(% rowspan="2" %)**Remarks**
2255 |(% colspan="2" %)**When R0 is specified in (s2)**|**Set content**
2256 |(% colspan="2" %)Coordinate points|(s2)+1, (s2)|R1, R0|K10|
2257 |(% rowspan="10" %)X|Point 1|(s2)+3, (s2)+2|R3, R2|K5|
2258 |Point 2|(s2)+5, (s2)+4|R5, R4|K20|
2259 |Point 3|(s2)+7, (s2)+6|R7, R6|K50|
2260 |Point 4|(s2)+9, (s2)+8|R9, R8|K200|(% rowspan="3" %)Refer to** ✎1**
2261 |Point 5|(s2)+11, (s2)+10|R10, R11|K200
2262 |Point 6|(s2)+13, (s2)+12|R13, R12|K200
2263 |Point 7|(s2)+15, (s2)+14|R15, R14|K250|
2264 |Point 8|(s2)+17, (s2)+16|R17, R16|K350|(% rowspan="2" %)Refer to** ✎2**
2265 |Point 9|(s2)+19, (s2)+18|R19, R18|K350
2266 |Point 10|(s2)+21, (s2)+20|R21, R20|K400|
2267 |(% rowspan="10" %)Y coordinate|Point 1|(s2)+23, (s2)+22|R23, R22|K7|
2268 |Point 2|(s2)+25, (s2)+24|R25, R24|K30|
2269 |Point 3|(s2)+27, (s2)+26|R27, R26|K100|
2270 |Point 4|(s2)+29, (s2)+28|R29, R28|K25|(% rowspan="3" %)Refer to** ✎1**
2271 |Point 5|(s2)+31, (s2)+30|R31, R30|K70
2272 |Point 6|(s2)+33, (s2)+32|R33, R32|K250
2273 |Point 7|(s2)+35, (s2)+34|R35, R34|K90|
2274 |Point 8|(s2)+37, (s2)+36|R37, R36|K90|(% rowspan="2" %)Refer to** ✎2**
2275 |Point 9|(s2)+39, (s2)+38|R39, R38|K30
2276 |Point 10|(s2)+41, (s2)+40|R41, R40|K7|
2277
2278 ✎**1** Like points 4, 5, and 6, if the coordinates are specified by 3 points, the intermediate value could be the output value.
2279
2280 In this example, the output value (median value) is specified by the Y coordinate of point 5.
2281
2282 When the X coordinate is the same at 3 or more points, the value of the second point is also output.
2283
2284 ✎**2** Like points 8 and 9, if the coordinates are specified by 2 points, the output value is the value of the Y coordinate of the next point.
2285
2286 In this example, the output value is specified by the Y coordinate of point 9.
2287
2288 **Error code**
2289
2290 |**Error code**|**Content**
2291 |4085H|When the specified device range for reading exceeds the range of the corresponding device.
2292 |4086H|When the specified device range for writing exceeds the range of the corresponding device.
2293 |4084H|(((
2294 When the Xn data of data table is not sorted in ascending order. However, the instruction will be executed until the position where the error occurs;
2295
2296 When the input value specified in (s1) exceeds the range of the set scale conversion data;
2297
2298 When the number of start coordinate points of device (s2) is less than 0.
2299 )))
2300
2301 **Example**
2302
2303 [[image:07-5 Basic instructions_html_91dbc16faa9d2ec3.png]]
2304
2305 When -100 ≤D0(X) < 0, D100(Y)=[[image:/xwiki/bin/download/PLC%20Editor2/1%20User%20manual/2.1%20LX5V%20user%20manual/07-5%20Basic%20instruction/WebHome/07-5%20Basic%20instructions_html_2c96d630f666e72c.gif?rev=1.1||alt="07-5 Basic instructions_html_2c96d630f666e72c.gif"]],,[[image:07-5 Basic instructions_html_2c96d630f666e72c.gif]] ,,;
2306
2307 when D0(X)=0, D100(Y)=0;
2308
2309 when 0< D0(X) ≤ 100, D100(Y)=[[image:/xwiki/bin/download/PLC%20Editor2/1%20User%20manual/2.1%20LX5V%20user%20manual/07-5%20Basic%20instruction/WebHome/07-5%20Basic%20instructions_html_47ebf5cc7733fccc.gif?rev=1.1||alt="07-5 Basic instructions_html_47ebf5cc7733fccc.gif"]],,[[image:07-5 Basic instructions_html_47ebf5cc7733fccc.gif]] ,,.
2310
2311 [[image:07-5 Basic instructions_html_a5b19d1af74a9620.png]]
2312
2313 {{id name="_Toc32057"/}}{{id name="_Toc9941"/}}{{id name="_Toc6492"/}}**ZONE/BIN 16-bit data zone control**
2314
2315 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] **ZONE(P)**
2316
2317 After adding the offset value specified in (s1) or (s2) to the input value specified in (s3), it is stored in the device number specified in (d).
2318
2319 -[ZONE (s1) (s2) (s3) (d)]
2320
2321 **Content, range and data type**
2322
2323 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
2324 |s1|The negative offset value for addition in the input value|-32,768 to 32,767|BIN16 bit|ANY16_S
2325 |s2|The positive offset value for addition in the input value|-32,768 to 32,767|BIN16 bit|ANY16_S
2326 |s3|Input value for zone control`|-32,768 to 32,767|BIN16 bit|ANY16_S
2327 |d|The start number of the device storing the output value controlled by zone control|-|BIN16 bit|ANY16_S
2328
2329 **Device used**
2330
2331 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
2332 **Pulse**
2333
2334 **extension**
2335 )))
2336 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
2337 |(% rowspan="4" %)ZONE|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
2338 |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
2339 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|●
2340 |Parameter 4| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
2341
2342 **Features**
2343
2344 After adding the offset value specified in (s1) or (s2) to the input value (BIN 16-bit value) specified in (s3), it is stored in the device number specified in (d). The offset value is controlled as follows.
2345
2346 |**Condition**|**The value stored in the output value**
2347 |When input value (s3)<0|Input value (s3) + negative offset value (s1)
2348 |When input value (s3)=0|0
2349 |When input value (s3)>0|Input value (s3) + positive offset value (s2)
2350
2351
2352 (((
2353 • When the output value stored in (d) is a signed BIN 16-bit value, and the operation result exceeds the range of -32,768 to 32,767, the situation is shown in the following example.
2354
2355 For example, when (s1) is -100 and (s3) is -32,768,
2356
2357 the output value = -32768+(-100)=8000H-FF9CH=7F9CH=32668.
2358
2359 [[image:07-5 Basic instructions_html_a2adbf9ccf8f839.png]]
2360
2361
2362
2363 )))
2364
2365 **Error code**
2366
2367 |**Error code**|**Content**
2368 |4085H|When the specified device range for reading exceeds the range of the corresponding device
2369 |4086H|When the specified device range for writing exceeds the range of the corresponding device
2370
2371 **Example**
2372
2373 [[image:07-5 Basic instructions_html_5da523c7765bf5be.png]]
2374
2375 When X000 is ON
2376
2377 • When D0<0, the value of (D0)+(-1,000) is stored in D1.
2378
2379 • When D0=0, 0 is stored in D1.
2380
2381 • When 0<D0, the value of (D0)+(1,000) is stored in D1.
2382
2383 {{id name="_Toc28351"/}}{{id name="_Toc11023"/}}{{id name="_Toc30269"/}}**DZONE/BIN 32-bit data zone control**
2384
2385 [[image:07-5 Basic instructions_html_11b3991e89e21efc.gif]] DZONE(P)
2386
2387 After adding the offset value specified in (s1) or (s2) to the input value specified in (s3), it is stored in the device number specified in (d).
2388
2389 -[DZONE (s1) (s2) (s3) (d)]
2390
2391 **Content, range and data type**
2392
2393 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
2394 |(s1)|The negative offset value for addition in the input value|-2147483648 to 2147483647|BIN32 bit|ANY32_S
2395 |(s2)|The positive offset value for addition in the input value|-2147483648 to 2147483647|BIN32 bit|ANY32_S
2396 |(s3)|Input value for zone control|-2147483648 to 2147483647|BIN32 bit|ANY32_S
2397 |(d)|The start number of the device storing the output value controlled by zone control|-|BIN32 bit|ANY32_S
2398
2399 **Device used**
2400
2401 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|(((
2402 **Pulse**
2403
2404 **extension**
2405 )))
2406 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
2407 |(% rowspan="4" %)DZONE|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
2408 |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|●
2409 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●|●
2410 |Parameter 4| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|●
2411
2412 **Features**
2413
2414 After adding the offset value specified in (s1) or (s2) to the input value (BIN 32-bit value) specified in (s3), it is stored in the device number specified in (d). The offset value is controlled as follows.
2415
2416 |**Condition**|**The value stored in the output value**
2417 |When input value ((s3), (s3)+1)<0|Input value ((s3), (s3)+1) + negative offset value (s1), (s1)+1
2418 |When input value ((s3), (s3)+1)=0|0
2419 |When input value ((s3), (s3)+1)>0|Input value ((s3), (s3)+1) + positive offset value (s2), (s2)+1
2420
2421
2422 (((
2423 • When the output value stored in (d) and (d)+1 is a signed BIN 32-bit value, and the operation result exceeds the range of -2,147,483,648 to 2,147,483,647, the situation is shown in the following example.
2424
2425 For example, (s1), (s1)+1 is -1,000, (s3), (s3)+1 is -2,147,483,648, then the output value=-2,147,483,648+(-1000)=80000000H+FFFFFC18H=2,147,482,648.
2426
2427 [[image:07-5 Basic instructions_html_2f3a96a2565c75c7.png]]
2428 )))
2429
2430 **Error code**
2431
2432 |**Error code**|**Content**
2433 |4085H|When the specified device range for reading exceeds the range of the corresponding device
2434 |4086H|When the specified device range for writing exceeds the range of the corresponding device
2435
2436 **Example**
2437
2438 [[image:07-5 Basic instructions_html_b831b14748df07ab.png]]
2439
2440 • When (D1, D0)<0, the value of (D1, D0)+(-10,000) is stored in (D11, D10).
2441
2442 • When (D1, D0)=0, 0 is stored in (D11, D10).
2443
2444 • When 0<(D1, D0), the value of (D1, D0)+10,000 is stored in (D11, D10).