Wiki source code of 12

Version 1.1 by Leo Wei on 2022/06/08 12:57

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