Changes for page 01 Program execution

Last modified by Leo Wei on 2024/12/24 22:42

From version 8.4
edited by Leo Wei
on 2022/07/28 15:57
Change comment: Update document after refactoring.
To version 1.1
edited by Leo Wei
on 2022/06/08 12:57
Change comment: Imported from XAR

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -01 Program execution
1 +01 Execution of the program
Parent
... ... @@ -1,1 +1,1 @@
1 -PLC Editor2.WebHome
1 +PLC Editor2.1 User manual.2\.1 LX5V user manual.WebHome
Content
... ... @@ -1,11 +1,11 @@
1 -= Scan structure =
1 += **The composition of the scan** =
2 2  
3 3  The scan configuration of the CPU module is as follows.
4 4  
5 5  (% style="text-align:center" %)
6 -[[image:1-1.png||height="455" width="700" class="img-thumbnail"]]
6 +[[image:1-1.png||class="img-thumbnail" height="455" width="700"]]
7 7  
8 -== Initialization ==
8 +== **Initialization** ==
9 9  
10 10  The initialization based on the status of the CPU module is as follows.
11 11  
... ... @@ -20,7 +20,7 @@
20 20  |Device initialization|√|×|√
21 21  |Error clear|√|×|√
22 22  
23 -== Input and output point refresh ==
23 +== **Input and output point refresh** ==
24 24  
25 25  Perform the following before starting program calculation.      
26 26  
... ... @@ -34,11 +34,11 @@
34 34  
35 35  When performing a constant scan, the I/O refresh is performed after the waiting time of the constant scan.
36 36  
37 -== Operation of the program ==
37 +== **Operation of the program** ==
38 38  
39 39  According to the program setting, the execution starts from step 0 of each program to the END instruction. This program is called the main program.
40 40  
41 -== END processing ==
41 +== **END processing** ==
42 42  
43 43  Perform the following processing.
44 44  
... ... @@ -47,16 +47,16 @@
47 47  * Communication processing
48 48  * Setting the value of special relay/special register (when the setting timing is END processing)
49 49  
50 -= Scan time =
50 += **Scan time** =
51 51  
52 52  The CPU module repeats the following processing, and the scan time is the total of the following processing and execution time.
53 53  
54 54  (% style="text-align:center" %)
55 -[[image:1-2.png||height="349" width="400" class="img-thumbnail"]]
55 +[[image:1-2.png||class="img-thumbnail" height="349" width="400"]]
56 56  
57 57  The initial scan time indicates the time including this processing.      
58 58  
59 -== Initial scan time ==
59 +== **Initial scan time** ==
60 60  
61 61  It is the first scan time of the CPU module in RUN.
62 62  
... ... @@ -64,12 +64,12 @@
64 64  
65 65  The value stored in SD134 (initial scan time (ms unit)) and SD135 (initial scan time (s unit)).
66 66  
67 -= The flow of each procedure =
67 += **The flow of each procedure** =
68 68  
69 69  When the CPU module changes to the RUN state, the programs are executed in sequence according to the program execution type and execution sequence settings.
70 70  
71 71  (% style="text-align:center" %)
72 -[[image:1652241271896-263.png||height="344" width="500" class="img-thumbnail"]]
72 +[[image:1652241271896-263.png||class="img-thumbnail" height="344" width="500"]]
73 73  
74 74  **Key points**
75 75  
... ... @@ -79,14 +79,14 @@
79 79  
80 80  When executing instructions that can be completed with multiple cycles (such as OUT T, RAMP, RS, etc.), they should be programmed in the scan program. If it is used in event execution type programs and mid-stage execution type programs, these instructions may not be executed in multiple scan cycles, causing actual results to be different from the ideal results. Therefore, unless events, interrupts and subroutines can be executed in each scan cycle. It is not recommended to use multi-cycle execution instructions in other situations.
81 81  
82 -= Types of program execution =
82 += **Types of program execution** =
83 83  
84 -== Scan execution program ==
84 +== **Scan execution program** ==
85 85  
86 86  Each scan is executed only once from the next scan of the initial execution type program.
87 87  
88 88  (% style="text-align:center" %)
89 -[[image:1-4.png||height="325" width="700" class="img-thumbnail"]]
89 +[[image:1-4.png||class="img-thumbnail" height="325" width="700"]]
90 90  
91 91  When multiple scan execution type programs are executed, the execution time of the scan execution type program is the time until all scan execution type programs are executed. In addition, before the execution of the scan execution type program is completed, if an interrupt program/event execution type program/subroutine is executed, the execution time will also be included.
92 92  
... ... @@ -95,7 +95,7 @@
95 95  "Project Management"→ "Program"→ "Scan"→ Right click to create
96 96  
97 97  (% style="text-align:center" %)
98 -[[image:1-5.png||height="372" width="300" class="img-thumbnail"]]
98 +[[image:1-5.png||class="img-thumbnail" height="372" width="300"]]
99 99  
100 100  * Scan the program name: the program name requires to match case, and the program name cannot use the same name with device name (the device name does not match case).
101 101  * The input of /%$@&=to`^<>?:{}[],;!*.~\~\'" is not supported. It cannot exceed 64 characters. The default name is MAINx.
... ... @@ -106,7 +106,7 @@
106 106  (% style="text-align:center" %)
107 107  [[image:1-6.png||class="img-thumbnail"]]
108 108  
109 -== Event execution program ==
109 +== **Event execution program** ==
110 110  
111 111  It uses the event specified by the user as a condition to trigger the program to start execution.
112 112  
... ... @@ -177,7 +177,7 @@
177 177  1. Project management→ Program→ Parameter → Program parameter→Configuration
178 178  
179 179  (% style="text-align:center" %)
180 -[[image:1-11.png||height="419" width="500" class="img-thumbnail"]]
180 +[[image:1-11.png||class="img-thumbnail" height="419" width="500"]]
181 181  
182 182  Configuration instructions:
183 183  
... ... @@ -184,7 +184,7 @@
184 184   1) Configuration interface
185 185  
186 186  (% style="text-align:center" %)
187 -[[image:1-12.png||height="372" width="300" class="img-thumbnail"]]
187 +[[image:1-12.png||class="img-thumbnail" height="372" width="300"]]
188 188  
189 189  2) Parameter content:
190 190  
... ... @@ -208,7 +208,7 @@
208 208  
209 209  When "ON event" or "TIME event" is specified, if "Clear or not" is set to "Clear", the event program will not be executed in one scan cycle, and all the internal outputs (Y) and current value of timer (T) will all be cleared (except for the cumulative type and subroutine type T). If the time set by the TIME event is less than the scan period, it is equivalent to executing the TIME event every scan period. Even if the clear output is set, the output and timer data in the event program will not be cleared.
210 210  
211 -== Interrupt execution program ==
211 +== **Interrupt execution program** ==
212 212  
213 213  In the process of executing the scan program, the program that can interrupt the priority execution of the scan program is called an interrupt execution program.
214 214  
... ... @@ -311,7 +311,7 @@
311 311  Double-click the newly created interrupt program in the project management to start writing the interrupt execution program. As shown in the figure above, a newly created interrupt program is INT_X0_UP, and the trigger condition is configured to execute the interrupt program when the X0 rising edge is configured. If the EI instruction is used in the main program to allow interrupts, all programs in INT_X0_UP will be executed whenever X0 changes from OFF to ON , That is, D0 will increment once.
312 312  
313 313  (% style="text-align:center" %)
314 -[[image:1652250056160-117.png||height="215" width="500" class="img-thumbnail"]]
314 +[[image:1652250056160-117.png||class="img-thumbnail" height="215" width="500"]]
315 315  
316 316  **~ 2.Timer interrupt**
317 317  
... ... @@ -577,7 +577,7 @@
577 577  ON: Mask interrupt OFF: Enable interrupt
578 578  )))|0
579 579  
580 -== Subroutine ==
580 +== **Subroutine** ==
581 581  
582 582  During the execution of the scan program, the executed program can be called by the CALL instruction.
583 583  
... ... @@ -602,7 +602,7 @@
602 602  1. The subroutine can be nested up to 32 levels. If the level exceeds 32 levels, a serious error will be reported and the Circuit program operation will be forcibly stopped.
603 603  1. Unlike the LX3V series mainframe, the subroutine in the LX5V series mainframe ends with the END instruction instead of SRET.
604 604  
605 -== Positioning instructions ==
605 +== **Positioning instructions** ==
606 606  
607 607   ~1. Event
608 608