Version 2.1 by Stone Wu on 2022/06/15 11:22

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