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

Show last authors
1 = **Contact instructions** =
2
3 == {{id name="_Operation_start,_series_connection,_par"/}}{{id name="_Toc18143"/}}{{id name="_Toc102982412"/}}{{id name="_Toc20447"/}}{{id name="_Toc6835"/}}**Operation start, series connection, parallel connection** ==
4
5 **LD, LDI, AND, ANI, OR, ORI**
6
7 • **LD:** Normally open contact instruction. **LD**I: Normally closed contact instruction.
8
9 Extract the ON/OFF information of the device specified in (s) as the result of the calculation.
10
11 • **AND: **Normally open contact series connection instruction. **ANI:** Normally closed contact series connection instruction.
12
13 Extract the ON/OFF information of the device specified in (s), and perform an AND operation with the calculation result so far as the calculation result.
14
15 • **OR:** Parallel connection instruction of 1 normally open contact. **ORI:** Parallel connection instruction of 1 normally closed contact
16
17 Extract the ON/OFF information of the device specified in (s), and perform an OR operation with the result of the operation so far as the result of the operation.
18
19 (% style="text-align:center" %)
20 [[image:新建 DOCX 文档_html_4debca1045bae382.png||class="img-thumbnail"]]
21
22 **Content, range and data type**
23
24 (% class="table-bordered" style="width:1100px" %)
25 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (tag)**
26 |(s)|Device used as contact|~-~--|Bit|ANY_BOOL
27
28 **Device used**
29
30 (% class="table-bordered" style="width:1100px" %)
31 |(% rowspan="2" style="width:63px" %)(((
32 (% class="small" %)**Instru-**
33
34 (% class="small" %)**ction**
35 )))|(% rowspan="2" style="width:98px" %)(((
36 (% class="small" %)**Para-**
37
38 (% class="small" %)**meter**
39 )))|(% colspan="10" style="width:809px" %)(% class="small" %)**Devices**|(% class="small" style="width:80px" %)(((
40 **Offset modifi**
41
42 **cation**
43 )))
44 |(% class="small" style="width:32px" %)**X**|(% class="small" %)**Y**|(% class="small" %)**M**|(% class="small" %)**S**|(% class="small" %)**SM**|(((
45 (% class="small" %)**T**
46
47 (% class="small" %)**(bit)**
48 )))|(((
49 (% class="small" %)**C**
50
51 (% class="small" %)**(bit)**
52 )))|(% style="width:36px" %)(((
53 (% class="small" %)**LC**
54
55 (% class="small" %)**(bit)**
56 )))|(% style="width:48px" %)(((
57 (% class="small" %)**HSC**
58
59 (% class="small" %)**(bit)**
60 )))|(% class="small" %)**D.b**|(% class="small" style="width:80px" %)**[D]**
61 |(% class="small" style="width:63px" %)LD|(% class="small" style="width:98px" %)(((
62 Param
63
64 -eter 1
65 )))|(% class="small" style="width:32px" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" style="width:36px" %)●|(% class="small" style="width:48px" %)●|(% class="small" %)●|(% class="small" style="width:80px" %)●
66 |(% class="small" style="width:63px" %)LDI|(% class="small" style="width:98px" %)(((
67 Param
68
69 eter 1
70 )))|(% class="small" style="width:32px" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" style="width:36px" %)●|(% class="small" style="width:48px" %)●|(% class="small" %)●|(% class="small" style="width:80px" %)●
71 |(% class="small" style="width:63px" %)AND|(% class="small" style="width:98px" %)(((
72 Para
73
74 meter 1
75 )))|(% class="small" style="width:32px" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" style="width:36px" %)●|(% class="small" style="width:48px" %)●|(% class="small" %)●|(% class="small" style="width:80px" %)●
76 |(% class="small" style="width:63px" %)ANI|(% class="small" style="width:98px" %)(((
77 Para
78
79 meter 1
80 )))|(% class="small" style="width:32px" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" style="width:36px" %)●|(% class="small" style="width:48px" %)●|(% class="small" %)●|(% class="small" style="width:80px" %)●
81 |(% class="small" style="width:63px" %)OR|(% class="small" style="width:98px" %)Parameter 1|(% class="small" style="width:32px" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" style="width:36px" %)●|(% class="small" style="width:48px" %)●|(% class="small" %)●|(% class="small" style="width:80px" %)●
82 |(% class="small" style="width:63px" %)ORI|(% class="small" style="width:98px" %)Parameter 1|(% class="small" style="width:32px" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" %)●|(% class="small" style="width:36px" %)●|(% class="small" style="width:48px" %)●|(% class="small" %)●|(% class="small" style="width:80px" %)●
83
84 **Features**
85
86 * **LD, LDI**
87
88 • The LD instruction is a normally open contact instruction, and the LDI instruction is a normally closed contact instruction. The ON/OFF information *1 of the specified device is extracted as the operation result.
89
90 *1: When the bit of the word device is specified, it is turned on/off according to 1/0 of the specified bit.
91
92 * **AND, ANI**
93
94 • The AND instruction is a normally open contact serial connection instruction, and the ANI instruction is a normally closed contact serial connection instruction. It extracts the ON/OFF information*1 of the specified bit device and performs an AND operation with the result of the operation so far. This value is used as the result of the operation.
95
96 *1: When the bit of the word device is specified, it is turned on/off according to 1/0 of the specified bit.
97
98 • There is no limit to the number of serial contacts, and this instruction can be used any time continuously.
99
100 • After the OUT instruction, it is called cascade output through the contact OUT to other coils. As long as the sequence is good, it can be repeated any number of times.
101
102 * **OR, ORI**
103
104 • The OR instruction is a parallel connection instruction for a normally open contact, and the ORI instruction is a parallel connection instruction for a normally closed contact. It extracts the ON/OFF information*1 of the specified device and compares it with the calculation result so far. Perform an OR operation and use the value as the result of the operation.
105
106 *1: When the bit of the word device is specified, it is turned on/off according to 1/0 of the specified bit.
107
108 • OR and ORI instructions start from the step where the instruction is located, and connect in parallel to the step where the previous LD and LDI instructions are located.
109
110 • There is no limit to the number of parallel connections.
111
112 **Key point**
113
114 When specifying the bit of a word device, the bit is specified with a hexadecimal number. (For example, b11 of D0 will become "D0.B")
115
116 **Error code**
117
118 (% class="table-bordered" %)
119 |**Error code**|**Content**
120 |4085H|(S) read address exceeds the device range
121
122 **Example**
123
124 **(1) LD instruction (the logic operation of a contact starts)**
125
126 (% style="text-align:center" %)
127 [[image:新建 DOCX 文档_html_948abbe4cfba788f.png||class="img-thumbnail"]]
128
129 **(2) LDI instruction (the logic operation of contact b starts)**
130
131 (% style="text-align:center" %)
132 [[image:新建 DOCX 文档_html_f0c869bb728ed108.png||class="img-thumbnail"]]
133
134 **(3) AND instruction (a contact in series)**
135
136 (% style="text-align:center" %)
137 [[image:新建 DOCX 文档_html_7b398a86610c200b.png||class="img-thumbnail"]]
138
139 **(4) ANI instruction (series b contact)**
140
141 (% style="text-align:center" %)
142 [[image:新建 DOCX 文档_html_da691d599e7b4879.png||class="img-thumbnail"]]
143
144 **(5) OR instruction (a contact in parallel)**
145
146 (% style="text-align:center" %)
147 [[image:新建 DOCX 文档_html_3a6ee5ecf3044f3f.png||class="img-thumbnail"]]
148
149 **(6) ORI instruction (a contact in parallel)**
150
151 (% style="text-align:center" %)
152 [[image:新建 DOCX 文档_html_463b9ee471040d5.png||class="img-thumbnail"]]
153
154 **(7) Offset modification**
155
156 The devices used in the LD, LDI, AND, ANI, OR, ORI instructions can all be indexed with D data devices (the status register S cannot be modified).
157
158 D0 to D7999 can be used in index modification.
159
160 When the devices are input (X) and output (Y), the value of the index register is converted into an octal number and then added.
161
162 **Example**
163
164 (% style="text-align:center" %)
165 [[image:新建 DOCX 文档_html_2223c9497674fa0b.png||class="img-thumbnail"]]
166
167 When the value of D0 is 10, X012 determines LD contact ON (conduction)/OFF (non-conduction).
168
169 **(8) Bit specification in the data register**
170
171 Among the devices used in the LD, LDI, AND, ANI, OR, and ORI instructions, the bits of the data register (D) can be specified.
172
173 When executing the bit specification of the data register, enter "." after the number of the data register (D), and then enter the bit number (0 to F). The usable data registers are specified in bits, but only 16-bit data registers are valid.
174
175 Please specify the bit number in the order of 0,1,2,…9,A,B,…F starting from the lower bit.
176
177 **Example**
178
179 {{id name="_Toc27056"/}}
180
181 (% style="text-align:center" %)
182 [[image:新建 DOCX 文档_html_8df6b0ab1c78035b.png||class="img-thumbnail"]]
183
184 The third bit of D0 determines the LD contact ON (conduction)/OFF (non-conduction).
185
186 == {{id name="_Toc102982413"/}}**{{id name="_Toc9281"/}}{{id name="_Toc2113"/}}Pulse calculation starts, pulse series connection, pulse parallel connection** ==
187
188 **LDP, LDF, ANDP, ANDF, ORP, ORF**
189
190 • LDP: Rising edge pulse operation start instruction.
191
192 Turns on only at the rising edge (OFF→ON) of the bit device specified in (s).
193
194 • LDF: Falling edge pulse operation start instruction.
195
196 Turns on only at the falling edge (ON→OFF) of the bit device specified in (s).
197
198 • ANDP: Rising edge pulse series connection instruction, ANDF: Falling edge pulse series connection instruction. The previous operation result up to that time is ANDed with the bit device specified in (s) as the operation result.
199
200 • ORP: Parallel connection instruction for rising edge pulse/ORF: Parallel connection instruction for falling edge pulse. The operation result up to that time is ORed with the bit device specified in (s) as the operation result.
201
202 (% style="text-align:center" %)
203 [[image:新建 DOCX 文档_html_73c09fbfd2ecd992.png||class="img-thumbnail"]]
204
205 **Content, range and data type**
206
207 (% class="table-bordered" %)
208 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
209 |(s)|Devices used as contacts|-|Bit|ANY_BOOL
210
211 **Device used**
212
213 (% class="table-bordered" %)
214 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**
215 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**[D]**
216 |LD|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
217 |LDI|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
218 |AND|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
219 |ANI|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
220 |OR|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
221 |ORI|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
222
223 **Features**
224
225 * **LDP, LDF**
226
227 {{id name="OLE_LINK155"/}}• The LDP instruction is a rising edge pulse operation start instruction, which turns on only at the rising edge (OFF→ON) of the specified bit device. When the bit of the word device is specified, it turns on only when the specified bit changes from 0→1. In the case of only the LDP instruction, it is the same as the pulsed instruction(P) of the instruction executed while ON.
228
229 When the circuit that uses the LDP instruction is replaced with a circuit that does not use the LDP instruction, the situation is as follows.
230
231 (% style="text-align:center" %)
232 [[image:新建 DOCX 文档_html_950644bad27c889.png||class="img-thumbnail"]]
233
234 • The LDF instruction is a falling edge pulse instruction, which turns on at the falling edge (ON→OFF) of the specified bit device. When the bit of the word device is specified, it turns on only when the specified bit changes from 1→0.
235
236 * **ANDP, ANDF**
237
238 • The ANDP instruction is a series connection instruction for rising edge pulses, and the ANDF instruction is a series connection instruction for falling edge pulses. The AND operation is performed with the operation result up to that time as the operation result. The ON/OFF information used in ANDP instructions and ANDF instructions is shown in the table below.
239
240 (% class="table-bordered" %)
241 |(% colspan="2" %)**Device specified in ANDP, ANDF**|(% rowspan="2" %)**ANDP status**|(% rowspan="2" %)**ANDF status**
242 |**Bit device**|**Bit specification of word device**
243 |OFF→ON|0→1|ON|OFF
244 |OFF|0|OFF|OFF
245 |ON|1|OFF|OFF
246 |ON→OFF|1→0|OFF|ON
247
248 * **ORP, ORF**
249
250 • The ORP instruction is a parallel connection instruction for rising edge pulses, and an ORF instruction is a parallel connection instruction for falling edge pulses. The OR operation is performed with the operation result up to that time as the operation result. The ON/OFF information used in ORP instructions and ORF instructions is shown in the table below.
251
252 (% class="table-bordered" %)
253 |(% colspan="2" %)**Device specified in ORP, ORF**|(% rowspan="2" %)**ORP status**|(% rowspan="2" %)**ORF status**
254 |**Bit device**|**Bit specification of word device**
255 |OFF→ON|0→1|ON|OFF
256 |OFF|0|OFF|OFF
257 |ON|1|OFF|OFF
258 |ON→OFF|1→0|OFF|ON
259
260 **Error code**
261
262 There is no operation error.
263
264 **Example**
265
266 **(1) LDP, ANDP, ORP instructions (calculation starts when a rising edge is detected, serial connection, parallel connection)**
267
268 (% style="text-align:center" %)
269 [[image:新建 DOCX 文档_html_27383c10594a9db2.gif||class="img-thumbnail"]]
270
271 (% style="text-align:center" %)
272 [[image:新建 DOCX 文档_html_3827d78368188647.png||class="img-thumbnail"]]
273
274 (% style="text-align:center" %)
275 [[image:新建 DOCX 文档_html_aaf20335abd9ab2c.png||class="img-thumbnail"]]
276
277 In the above figure, when X000 to X002 changes from OFF to ON, M0 or M1 only maintains ON for 1 operation cycle.
278
279 **(2) LDF, ANDF, ORF instructions (calculation starts when a falling edge is detected, serial connection, parallel connection)**
280
281 (% style="text-align:center" %)
282 [[image:新建 DOCX 文档_html_25f75cd2184b446c.gif||class="img-thumbnail"]]
283
284 (% style="text-align:center" %)
285 [[image:新建 DOCX 文档_html_85b81e1e1a420c57.png||class="img-thumbnail"]]
286
287 In the above figure, when X000 to X002 changes from ON to OFF, M0 or M1 only maintains ON for 1 operation cycle.
288
289 **(3) Bit specification of data register (D)**
290
291 In the devices used for LDP, LDF, ANDP, ANDF, ORP, ORF instructions, the bits of the data register (D) can be specified.
292
293 To specify the bit of the data register, enter "." after the number of the data register (D), and then enter the bit number (0 to F). The usable data registers are specified in bits, but only 16-bit data registers are valid.
294
295 Please specify the bit number in the order of 0,1,2,...9,A,B,...F starting from the low order.
296
297 **Example:**
298
299 (% style="text-align:center" %)
300 [[image:新建 DOCX 文档_html_c7028515b1f19432.png||class="img-thumbnail"]]
301
302 The third bit of D0 determines the LDP contact ON (conduction)/OFF (non-conduction) when it changes from OFF to ON.
303
304 = {{id name="_Toc24267"/}}**Combining instructions** =
305
306 == {{id name="_Toc102982415"/}}**Series connection and parallel connection of Circuit program blocks** ==
307
308 **ANB, ORB**
309
310 Perform AND operation or OR operation between block A and block B, and use it as the result of the operation.
311
312 **Circuit program**
313
314 (% style="text-align:center" %)
315 [[image:新建 DOCX 文档_html_ce628cf66494663d.png||class="img-thumbnail"]]
316
317 **Features**
318
319 * **ANB**
320
321 • Perform AND operation of block A and block B and use it as the result of the operation.
322
323 • The Sign of the ANB instruction is not a contact Sign, but a connection Sign.
324
325 * **ORB**
326
327 • Perform OR operation of block A and block B, and use it as the result of the operation.
328
329 • The ORB instruction connects circuit blocks with 2 or more contacts in parallel. The parallel connection of only 1 contact uses OR instruction and ORI instruction, without ORB instruction.
330
331 • The Sign of the ORB instruction is not a contact Sign, but a connection Sign.
332
333 **Error code**
334
335 There is no operation error.
336
337 **Example**
338
339 (% style="text-align:center" %)
340 [[image:新建 DOCX 文档_html_f67e0512993c8de9.png||class="img-thumbnail"]]
341
342 == {{id name="_Toc102982416"/}}**{{id name="_Toc4344"/}}{{id name="_Toc5761"/}}{{id name="_Toc11619"/}}Push, read, and pop of calculation results** ==
343
344 **MPS, MRD, MPP**
345
346 • MPS: Store the calculation result (ON/OFF) before the MPS instruction.
347
348 • MRD, MPP: Read the operation result stored by the MPS instruction, and start the operation from the next step with the operation result.
349
350 **Circuit program**
351
352 (% style="text-align:center" %)
353 [[image:新建 DOCX 文档_html_b1f19e624d81311a.png||class="img-thumbnail"]]
354
355 **Features**
356
357 * **MPS**
358
359 • Store the operation result (ON/OFF) before the MPS instruction.
360
361 • The MPS instruction can be used continuously up to 11 times. If the MPP instruction is used in the middle, the number of uses of the MPS instruction will be -1.
362
363 * **MRD**
364
365 • Read the operation result stored by the MPS instruction, and start the operation from the next step with the operation result.
366
367 * **MPP**
368
369 • Read the operation result stored by the MPS instruction, and start the operation from the next step with the operation result.
370
371 • Clear the operation result stored by the MPS instruction.
372
373 • The used number of MPS instructions will be -1.
374
375 **Error code**
376
377 There is no operation error.
378
379 **Example**
380
381 MPS, MRD, MPP instructions (push stack, read stack, pop stack)
382
383 (% style="text-align:center" %)
384 [[image:新建 DOCX 文档_html_d284a65ea6c513bb.png||class="img-thumbnail"]]
385
386 • After using the MPS instruction to store the intermediate result of the operation, it drives the output Y002.
387
388 • After reading the storage content using MRD instruction, drive output Y003.
389
390 The MRD instruction can be programmed multiple times.
391
392 • Use the MPP instruction to replace the MRD instruction in the final output loop, so as to reset it while reading the above-mentioned stored content.
393
394 == {{id name="_Toc102982417"/}}**{{id name="_Toc23018"/}}{{id name="_Toc21839"/}}{{id name="_Toc32034"/}}Invert the result of operation** ==
395
396 **{{id name="_Toc7004"/}}INV**
397
398 Invert the results of operations up to the INV instruction.
399
400 **Circuit program**
401
402 (% style="text-align:center" %)
403 [[image:新建 DOCX 文档_html_382e3f914f1c04dd.png||class="img-thumbnail"]]
404
405 **Features**
406
407 Invert the results of operations up to the INV instruction.
408
409 (% class="table-bordered" %)
410 |**Operation result before INV instruction**|**Operation result after INV instruction is executed**
411 |OFF|ON
412 |ON|OFF
413
414 **Error code**
415
416 There is no operation error.
417
418 **Point**
419
420 • The INV instruction executes the operation as a result of the previous operation, so it should be used in the same position as the AND instruction. INV instruction cannot be used in the position of LD and OR instructions.
421
422 • When the INV instruction and ANB instruction are used together for ladder operation, pay attention to the inverted range.
423
424 (% style="text-align:center" %)
425 [[image:新建 DOCX 文档_html_4b05e4cf8f442b5d.png||class="img-thumbnail"]]
426
427 **Example**
428
429 INV instruction (reverse operation result)
430
431 (% style="text-align:center" %)
432 [[image:新建 DOCX 文档_html_715361cb76e4a13c.png||class="img-thumbnail"]]
433
434 == {{id name="_Toc9460"/}}**{{id name="_Toc27367"/}}Pulse operation result** ==
435
436 **MEP, MEF**
437
438 • MEP: Turns on when the operation result before the MEP instruction is a rising edge, and turns off when it is not a rising edge.
439
440 • MEF: Turns on when the operation result before MEF instruction is a falling edge, and turns off when it is not a falling edge.
441
442 **Circuit program**
443
444 (% style="text-align:center" %)
445 [[image:新建 DOCX 文档_html_28f44b3762e4a354.png||class="img-thumbnail"]]
446
447 **Features**
448
449 * **MEP**
450
451 • When the operation result before the MEP instruction is a rising edge (OFF→ON), it becomes ON (conduction state). When the operation result before the MEP instruction is other than the rising edge, it turns off (non-conduction state).
452
453 • When using the MEP instruction, if multiple contacts are connected in series, pulse processing will be easier.
454
455 * **MEF**
456
457 • When the operation result before the MEF instruction is a falling edge (ON→OFF), it becomes ON (conduction state). When the operation result before the MEF instruction is other than the falling edge, it turns OFF (non-conduction state).
458
459 • When using the MEF instruction, if multiple contacts are connected in series, pulse processing will be easier.
460
461 **Error code**
462
463 There is no operation error.
464
465 **Point**
466
467 • For MEP instructions and MEF instructions, if the indexed contacts are pulsed by subroutines, FOR to NEXT instructions, etc., they may not operate normally.
468
469 • The MEP instruction and MEF instruction perform actions based on the previous calculation results, so they should be used in the same position as the AND instruction. The MEP instruction and MEF instruction cannot be used in the position of LD instruction and OR instruction.
470
471 **Example**
472
473 **(1) MEP instruction (ON at the rising edge of the operation result)**
474
475 (% style="text-align:center" %)
476 [[image:新建 DOCX 文档_html_1dbdc74ad3b7875.png||class="img-thumbnail"]]
477
478 **(2) MEF instruction (ON at the falling edge of the operation result)**
479
480 (% style="text-align:center" %)
481 [[image:新建 DOCX 文档_html_59ffaf2ed3543b09.png||class="img-thumbnail"]]
482
483 = {{id name="_Toc17879"/}}**Output instructions** =
484
485 == {{id name="_Toc2355"/}}**OUT instruction (except timers and counters)** ==
486
487 Output the results of the previous OUT instruction to the specified device.
488
489 **Circuit program**
490
491 (% style="text-align:center" %)
492 [[image:新建 DOCX 文档_html_635bed7829c89cb.png||class="img-thumbnail"]]
493
494 **Content, range and data type**
495
496 (% class="table-bordered" %)
497 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
498 |(d)|ON/OFF device number|-|Bit|ANY_BOOL
499
500 **Device used**
501
502 (% class="table-bordered" %)
503 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**
504 |**X**|**Y**|**M**|**S**|**SM**|**D.b**|**T**|**C**|**LC**|**HSC**|**[D]**
505 |OUT|Parameter 1|●|●|●|●|●|●|●|●|●|●|●
506
507 * Refer to OUT T instruction when using T;
508 * Refer to OUT C instruction when using C, LC, HSC;
509 * Offset modification cannot be used when using S device.
510
511 **Features**
512
513 Outputs the results of the previous OUT instruction to the specified device.
514
515 (% class="table-bordered" %)
516 |**Condition**|**Calculation result**|**Coil / specified position**
517 |(% rowspan="2" %)When using bit devices|OFF|OFF
518 |ON|ON
519 |(% rowspan="2" %)When using word devices|OFF|0
520 |ON|1
521
522 **Error code**
523
524 (% class="table-bordered" %)
525 |**Error code**|**Content**
526 |4086H|(D) write address exceeds the device range
527
528 **Example**
529
530 **{{id name="_Toc29563"/}}(1) When using bit devices**
531
532 The device programmed with the OUT instruction executes ON/OFF according to the state of the drive contact, and the parallel OUT instruction can be used continuously for many times.
533
534 In the following program example, OUT M101 followed by OUT M100 means this.
535
536 However, if multiple OUT instructions are used for the same device number, it will become a dual output (double coil). Please be careful.
537
538 {{id name="_Toc19661"/}}
539
540 (% style="text-align:center" %)
541 [[image:新建 DOCX 文档_html_52169275b8a6b44c.png||class="img-thumbnail"]]
542
543
544 (% style="text-align:center" %)
545 [[image:新建 DOCX 文档_html_24c27f07fc29051c.png||class="img-thumbnail"]]
546
547 **(2) Offset modification**
548
549 All the devices used in the OUT instruction can be indexed with the D data device (the status register S cannot be modified).
550
551 D0 to D7999 can be used in index modification.
552
553 When the devices used are input (X) and output (Y), the value of the index register is converted to an octal number and then added.
554
555 **Example:**
556
557 (% style="text-align:center" %)
558 [[image:新建 DOCX 文档_html_3c362c2623291a7f.png||class="img-thumbnail"]]
559
560 When the value of D0 is 10, when X0 is ON (conducting), the Y12 contact is ON (conducting).
561
562 **{{id name="_Toc6295"/}}(3) Bit specification in the data register**
563
564 Among the devices used in the OUT instruction, the bit of the data register (D) can be specified.To specify the bit of the data register, enter "." after the number of the data register (D), and then enter the bit number (0 to F). The usable data registers are specified in bits, but only 16-bit data registers are valid.
565
566 Please indicate the positioning number in the order of 0,1,2,...9,A,B,...F starting from the low order.
567
568 **Example:**
569
570 (% style="text-align:center" %)
571 [[image:新建 DOCX 文档_html_700bcac03b22d7ee.png||class="img-thumbnail"]]
572
573 In the example on the left, the state of X1 determines the ON (conduction)/OFF (non-conduction) of the third bit in D0.
574
575 == {{id name="_Toc21196"/}}**{{id name="_Toc102982421"/}}{{id name="_Toc8098"/}}{{id name="_Toc365"/}}SET instruction** ==
576
577 When the execution instruction turns ON, the device specified in (d) will be in the following state.
578
579 • Bit device: Turn on the coil and contact.
580
581 • Bit specification of word device: Set the specified position to 1.
582
583 (% style="text-align:center" %)
584 [[image:新建 DOCX 文档_html_15b6f5f733a8361d.png||class="img-thumbnail"]]
585
586 **Content, range and data type**
587
588 (% class="table-bordered" %)
589 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
590 |(d)|Set (ON) bit device number/bit specification of word device|-|Bit|ANY_BOOL
591
592 **Device used**
593
594 (% class="table-bordered" %)
595 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="6" %)**Devices**|**Offset modification**
596 |**X**|**Y**|**M**|**S**|**SM**|**D.b**|**[D]**
597 |SET|Parameter 1|●|●|●|●|●|●|●
598
599 *1: Offset modification cannot be used when using S devices.
600
601 **Features**
602
603 When the execution instruction turns ON, the device specified in (d) will be in the following state.
604
605 (% class="table-bordered" %)
606 |**Devices**|**Device status**
607 |Bit Device|Turn on the coil and contact
608 |Bit specification of word device|Set the specified position to 1
609
610 The device that is turned on will remain on even if the execution instruction turns off. The device that is turned ON by the SET instruction can be turned OFF by the RST instruction.
611
612 (% style="text-align:center" %)
613 [[image:新建 DOCX 文档_html_594cb1456a9831b1.png||class="img-thumbnail"]]
614
615 **{{id name="OLE_LINK156"/}}✎Note: **
616
617 For the output relay (Y), if the SET instruction and the RST instruction are executed in the same operation, the instruction result close to the END instruction (end of program) will be output.
618
619 **Error code**
620
621 (% class="table-bordered" %)
622 |**Error code**|**Content**
623 |4086H|(d) In the case of using offset, the offset address exceeds the device range
624
625 **Example**
626
627 **(1) When using bit devices**
628
629 The parallel SET instruction could be used multiple times in succession. In the following program example, this is the case for the program with SET Y000 followed by RST Y000.
630
631 (% style="text-align:center" %)
632 [[image:新建 DOCX 文档_html_4d89f9ebac17bedb.png||class="img-thumbnail"]]
633
634 **(2) Offset modification**
635
636 All the devices used in the SET instruction can be indexed with D data devices (the status register S cannot be modified).
637
638 D0 to D7999 can be used in index modification.
639
640 When the devices used are input (X) and output (Y), the value of the index register is converted into octal number and then added.
641
642 **Example:**
643
644 (% style="text-align:center" %)
645 [[image:新建 DOCX 文档_html_a75aaa4df9f02b33.png||class="img-thumbnail"]]
646
647 When the value of D0 is 10, when X0 is ON (conduction), the Y12 contact is ON (conduction), X0 is OFF (non-conduction), and the Y12 contact remains unchanged.
648
649 **(3) Bit specification in the data register**
650
651 Among the devices used in the SET instruction, the bits of the data register (D) can be specified.
652
653 To specify the bit of the data register, enter "." after the number of the data register (D), and then enter the bit number (0 to F). The usable data registers are specified in bits, but only 16-bit data registers are valid.
654
655 Please specify the bit number in the order of 0,1,2,…9,A,B,…F starting from the lower bit.
656
657 **Example:**
658
659 (% style="text-align:center" %)
660 [[image:新建 DOCX 文档_html_4fa02000dd7cc7c8.png||class="img-thumbnail"]]
661
662 In the example on the left, the state of X1 is ON (conduction), and the third bit in D0 is ON (conduction). The state of X1 is OFF (non-conduction), and the state of the third bit in D0 remains unchanged.
663
664 **{{id name="_Toc102982422"/}}{{id name="_Toc27574"/}}{{id name="_Toc26"/}}{{id name="_Toc802"/}}RST instruction**
665
666 When the RST input turns ON, the device specified in (d) will change to the following state.
667
668 • Bit device: Turn off the coil and contact.
669
670 • Timers and counters: Set the current value to 0, and set the coil and contact to OFF.
671
672 • Bit specification of word device: Set the specified position to 0.
673
674 • Word device, module access device, index register: Set the content to 0.
675
676 (% style="text-align:center" %)
677 [[image:新建 DOCX 文档_html_15b6f5f733a8361d.png||class="img-thumbnail"]]
678
679 **Content, range and data type**
680
681 (% class="table-bordered" %)
682 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
683 |(d)|Reset bit device number/bit specification of word device or reset word device number|-|Bit/word/double word|ANY_ELEMENTARY
684
685 **Device used**
686
687 (% class="table-bordered" %)
688 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="17" %)**Devices**|**Offset modification**
689 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**[D]**
690 |RST|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|●
691
692 *1: Offset modification cannot be used when using S devices.
693
694 **Features**
695
696 When the execution Instruction is ON, the specified device will be in the following state.
697
698 (% class="table-bordered" %)
699 |**Devices**|**Device status**
700 |Bit Device|Turn on the coil and contact
701 |Timer, counter|Set the current value to 0, set the coil and contact to OFF
702 |Bit specification of word device|Set the specified position to 0
703 |Word device|Set the content to 0
704
705 When the execution instruction is OFF, the device status does not change.
706
707 The function when specifying a word device with the RST instruction is the same as the following Circuit program.
708
709 (% style="text-align:center" %)
710 [[image:新建 DOCX 文档_html_bc583793d90dd044.png||class="img-thumbnail"]]
711
712 **{{id name="OLE_LINK146"/}}✎Note: **
713
714 For timers and counters, when the RST instruction is executed in the program, subroutine, and interrupt program where the RST instruction is jumped, the timer and counter may remain unchanged after reset, and the timer and counter will not operate.
715
716 **Error code**
717
718 (% class="table-bordered" %)
719 |**Error code**|**Content**
720 |4086H|(d) write address exceeds the device range
721
722 **Example**
723
724 **(1) Use bit device**
725
726 (((
727 When X0 is ON (conducting), Y0 is set to OFF, R10 is set to 0, the word device of T10 is set to 0, the bit device is set to OFF, and the word device of C100 is set to 0. The device is turned off.
728
729 When X0 is OFF (non-conduction), all states remain unchanged.
730
731 (% style="text-align:center" %)
732 [[image:新建 DOCX 文档_html_ca5aed9247ba3857.png||class="img-thumbnail"]]
733 )))
734
735 **(2) Offset modification**
736
737 All the devices used in the RST instruction can be indexed with D data devices. (The status register S could not be modified)
738
739 D0 to D7999 can be used in index modification.
740
741 When the devices used are input (X) and output (Y), the value of the index register is converted into an octal number and then added.
742
743 **Example**
744
745 (% style="text-align:center" %)
746 [[image:新建 DOCX 文档_html_b666b84943b87279.png||class="img-thumbnail"]]
747
748 When the value of D0 is 10, when X0 is ON (conduction), the Y12 contact is OFF (conduction), X0 is OFF (non-conduction), and the Y12 contact remains unchanged.
749
750 **(3) Bit specification in the data register**
751
752 Among the devices used in the RST instruction, the bits of the data register (D) can be specified.
753
754 To specify the bit of the data register, enter "." after the number of the data register (D), and then enter the bit number (0 to F). The usable data registers are specified in bits, but only 16-bit data registers are valid.
755
756 Please specify the bit number in the order of 0,1,2,…9,A,B,…F starting from the lower bit.
757
758 **Example**
759
760 (% style="text-align:center" %)
761 [[image:新建 DOCX 文档_html_b666b84943b87279.png||class="img-thumbnail"]]
762
763 In the example on the left, the state of X1 is ON (conduction), and the third bit in D0 is OFF (conduction). The state of X1 is OFF (non-conduction), and the state of the third bit in D0 remains unchanged.
764
765 == {{id name="_Toc15270"/}}**PLF/Falling edge output** ==
766
767 {{id name="OLE_LINK158"/}}When the PLF instruction is ON→OFF, one scan of the device specified in (d) is ON, and when it is other than ON→OFF, it is OFF.
768
769 (% style="text-align:center" %)
770 [[image:新建 DOCX 文档_html_15b6f5f733a8361d.png||class="img-thumbnail"]]
771
772 **Content, range and data type**
773
774 (% class="table-bordered" %)
775 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
776 |(d)|Pulsed device|-|Bit|ANY_BOOL
777
778 **Device used**
779
780 (% class="table-bordered" %)
781 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="6" %)**Devices**|**Offset modification**
782 |**X**|**Y**|**M**|**S**|**SM**|**D.b**|**[D]**
783 |PLF|Parameter 1|●|●|●|●|●|●|
784
785 **Features**
786
787 When the execution instruction is ON→OFF, the specified device is turned ON, and when the execution instruction is other than ON→OFF, it is turned OFF. When there is one PLF instruction for the device specified in (d) in one scan, the specified device will turn on one scan.
788
789 (% style="text-align:center" %)
790 [[image:新建 DOCX 文档_html_87ff2fa9f7df8f73.gif||class="img-thumbnail"]]
791
792 **✎Note: **
793
794 If the PLF instruction is jumped by the CJ instruction, or the executed subroutine is not called by the CALL(P) instruction, the device specified in (d) may be turned on for more than one scan. Be careful.
795
796 **Error code**
797
798 No Error code
799
800 **Example**
801
802 PLF instruction (differential output of falling edge)
803
804 (% style="text-align:center" %)
805 [[image:新建 DOCX 文档_html_fe65278b9e011373.png||class="img-thumbnail"]]
806
807 In the above figure, when X000 changes from ON to OFF, only one operation cycle of M1 is ON.
808
809 == {{id name="_Toc12151"/}}**{{id name="_Toc10194"/}}{{id name="_Toc8899"/}}{{id name="_Toc102982424"/}}PLS/Rising edge output** ==
810
811 When the PLS instruction is OFF→ON, one scan of the device specified in (d) is turned ON, and when it is other than OFF→ON, it is turned OFF.
812
813 (% style="text-align:center" %)
814 [[image:新建 DOCX 文档_html_15b6f5f733a8361d.png||class="img-thumbnail"]]
815
816 **Content, range and data type**
817
818 (% class="table-bordered" %)
819 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
820 |(d)|Pulsed device|-|Bit|ANY_BOOL
821
822 **Device used**
823
824 (% class="table-bordered" %)
825 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="6" %)**Devices**|**Offset modification**
826 |**X**|**Y**|**M**|**S**|**SM**|**D.b**|**[D]**
827 |PLS|Parameter 1|●|●|●|●|●|●|
828
829 **Features**
830
831 When the PLS instruction is OFF→ON, one scan of the specified device is turned on, and when it is other than OFF→ON, it is turned off. When there is one PLS instruction for the device specified in (d) in one scan, the specified device turns on one scan.
832
833 (% style="text-align:center" %)
834 [[image:新建 DOCX 文档_html_698ff9483510a9b2.gif||class="img-thumbnail"]]
835
836 **✎Note: **
837
838 If the PLS instruction is jumped by the CJ instruction, or the executed subroutine is not called by the CALL(P) instruction, the device specified in (d) may be turned on for more than one scan. Be careful.
839
840 **Error code**
841
842 No Error code
843
844 **Example**
845
846 PLS instruction (differential output on rising edge)
847
848 (% style="text-align:center" %)
849 [[image:新建 DOCX 文档_html_318a6f6b9e832934.png||class="img-thumbnail"]]
850
851 In the above figure, when X000 changes from OFF to ON, only one operation cycle of M0 is ON.
852
853 = {{id name="_Toc16832"/}}**END/Sequence control program end instruction** =
854
855 Indicates the final end of the program.
856
857 (% style="text-align:center" %)
858 [[image:新建 DOCX 文档_html_41b16690adeea9a.png||class="img-thumbnail"]]
859
860 **Features**
861
862 Indicates the end of the program including the main program, subprogram, interrupt program, and event. When the END instruction is executed, the CPU module will end the program being executed.
863
864 (% style="text-align:center" %)
865 [[image:新建 DOCX 文档_html_e8d2199557a88263.gif||class="img-thumbnail"]]