Changes for page 09 Lua Editor

Last modified by Nhu Nguyen on 2025/03/09 17:22

From version 1.1
edited by Leo Wei
on 2022/06/08 12:57
Change comment: Imported from XAR
To version 2.1
edited by Joey
on 2022/06/16 15:07
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.admin
1 +XWiki.Joey
Content
... ... @@ -8,23 +8,23 @@
8 8  
9 9  **[[1.2 Script Editor>>path:#_Toc42782937]]**
10 10  
11 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**1.2.1 Tool bar**__ 5>>path:#_Toc42782938]]
11 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**1.2.1 Tool bar**__ 5>>path:#_Toc42782938]]
12 12  
13 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**1.2.2 Editor area**__ 5>>path:#_Toc42782939]]
13 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**1.2.2 Editor area**__ 5>>path:#_Toc42782939]]
14 14  
15 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**1.2.3 Output area**__ 5>>path:#_Toc42782940]]
15 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**1.2.3 Output area**__ 5>>path:#_Toc42782940]]
16 16  
17 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**2 Lua object**__ 6>>path:#_Toc42782941]]
17 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**2 Lua object**__ 6>>path:#_Toc42782941]]
18 18  
19 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**2.1 How to use LuaScrip object**__ 6>>path:#_Toc42782942]]
19 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**2.1 How to use LuaScrip object**__ 6>>path:#_Toc42782942]]
20 20  
21 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**3 Platform**__ 7>>path:#_Toc42782943]]
21 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**3 Platform**__ 7>>path:#_Toc42782943]]
22 22  
23 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**3.1 File header identification**__ 7>>path:#_Toc42782944]]
23 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**3.1 File header identification**__ 7>>path:#_Toc42782944]]
24 24  
25 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**3.2 Special script file**__ 8>>path:#_Toc42782945]]
25 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**3.2 Special script file**__ 8>>path:#_Toc42782945]]
26 26  
27 -[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**3.3** **Script type (operating mechanism)**__ 9>>path:#_Toc42782946]]
27 +[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__**3.3** **Script type (operating mechanism)**__ 9>>path:#_Toc42782946]]
28 28  
29 29  Lua script is currently only available in PI+ or models ending with i(like PI3070i). Only these two types of HMI can use the Lua editor and object to develop lua scripts. The following operations are based on PI3070i project.
30 30  
... ... @@ -31,11 +31,11 @@
31 31  This article only introduces the use of lua object in PIStudio.
32 32  
33 33  (% style="text-align:center" %)
34 -[[image:HMI Lua Editor user manual_html_90c08e4cdcf4210c.png||class="img-thumbnail" height="484" width="500"]]
34 +[[image:HMI Lua Editor user manual_html_90c08e4cdcf4210c.png||height="484" width="500" class="img-thumbnail"]]
35 35  
36 36  
37 37  (% style="text-align:center" %)
38 -[[image:HMI Lua Editor user manual_html_674bb6778b0f003.png||class="img-thumbnail" height="487" width="500"]]
38 +[[image:HMI Lua Editor user manual_html_674bb6778b0f003.png||height="487" width="500" class="img-thumbnail"]]
39 39  
40 40  {{id name="_Toc42782932"/}}
41 41  
... ... @@ -44,7 +44,7 @@
44 44  The editor is divided into two areas, one is the script file area, and the other is the script editing area.
45 45  
46 46  (% style="text-align:center" %)
47 -[[image:HMI Lua Editor user manual_html_34da990820a7a4e5.png||class="img-thumbnail" height="208" width="400"]]
47 +[[image:HMI Lua Editor user manual_html_34da990820a7a4e5.png||height="208" width="400" class="img-thumbnail"]]
48 48  
49 49  {{id name="_Toc42782933"/}}{{id name="_Toc14144"/}}{{id name="_Toc22413"/}}**1.1 Script file area**
50 50  
... ... @@ -69,7 +69,7 @@
69 69  After creating a new file, expand the Lua node to display several script files. The following is referred to as child nodes.
70 70  
71 71  (% style="text-align:center" %)
72 -[[image:HMI Lua Editor user manual_html_fc10128583a230da.png||class="img-thumbnail" height="143" width="200"]]
72 +[[image:HMI Lua Editor user manual_html_fc10128583a230da.png||height="143" width="200" class="img-thumbnail"]]
73 73  
74 74  Child node color description:
75 75  
... ... @@ -104,7 +104,7 @@
104 104  Open any script file, the toolbar is as follows:
105 105  
106 106  (% style="text-align:center" %)
107 -[[image:HMI Lua Editor user manual_html_59f8bacea4239441.png||class="img-thumbnail" height="29" width="279"]]
107 +[[image:HMI Lua Editor user manual_html_59f8bacea4239441.png||height="29" width="279" class="img-thumbnail"]]
108 108  
109 109  Save, cut, copy, paste, word address, bit address, zoom in, zoom out, display spaces and tabs, grammar check.
110 110  
... ... @@ -135,7 +135,7 @@
135 135  Lua objects are mainly used to call functions and complete user interface interactions. Normally, functions should not be written in objects. Next, we will explain how to use the objects.
136 136  
137 137  (% style="text-align:center" %)
138 -[[image:HMI Lua Editor user manual_html_a9a41fb25f413fec.png||class="img-thumbnail" height="317" width="150"]]
138 +[[image:HMI Lua Editor user manual_html_a9a41fb25f413fec.png||height="317" width="150" class="img-thumbnail"]]
139 139  
140 140  {{id name="_Toc42782942"/}}{{id name="_Toc888"/}}{{id name="_Toc26065"/}}**2.1 How to use LuaScrip object**
141 141  
... ... @@ -142,7 +142,7 @@
142 142  Find the custom part->LuaScript on the right side, drag and draw to generate a part. Double-click the part to pop up a dialog box.
143 143  
144 144  (% style="text-align:center" %)
145 -[[image:HMI Lua Editor user manual_html_14bab1899c9ccc62.png||class="img-thumbnail" height="267" width="400"]]
145 +[[image:HMI Lua Editor user manual_html_14bab1899c9ccc62.png||height="267" width="400" class="img-thumbnail"]]
146 146  
147 147  Click Lua object will trigger two actions, that is, rising and falling scripts;
148 148  
... ... @@ -163,7 +163,7 @@
163 163  Any new file will automatically generate a line of code, as shown below:
164 164  
165 165  (% style="text-align:center" %)
166 -[[image:HMI Lua Editor user manual_html_40558d3555455933.png||class="img-thumbnail" height="116" width="270"]]
166 +[[image:HMI Lua Editor user manual_html_40558d3555455933.png||height="116" width="270" class="img-thumbnail"]]
167 167  
168 168  The format of this variable: file name_limits = number
169 169  
... ... @@ -170,7 +170,7 @@
170 170  The file name comes from the newly created file name (without suffix):
171 171  
172 172  (% style="text-align:center" %)
173 -[[image:HMI Lua Editor user manual_html_52fb935bcc76d7ad.png||class="img-thumbnail" height="113" width="203"]]
173 +[[image:HMI Lua Editor user manual_html_52fb935bcc76d7ad.png||height="113" width="203" class="img-thumbnail"]]
174 174  
175 175  **_limits**:Fixed format, cannot be modified
176 176  
... ... @@ -189,7 +189,7 @@
189 189  ~1. Script_BG.lua is a global background script file, which includes initialization and polling functions
190 190  
191 191  (% style="text-align:center" %)
192 -[[image:HMI Lua Editor user manual_html_5eb1ad5776f18955.png||class="img-thumbnail" height="148" width="200"]]
192 +[[image:HMI Lua Editor user manual_html_5eb1ad5776f18955.png||height="148" width="200" class="img-thumbnail"]]
193 193  
194 194  we_bg_init(): global initialization, that is, execute once when power on.
195 195  
... ... @@ -198,7 +198,7 @@
198 198  1. Script_Screen.lua is a screen script file, and each screen has an initialization, polling, and closing functions
199 199  
200 200  (% style="text-align:center" %)
201 -[[image:HMI Lua Editor user manual_html_e6807eb0da0eedd4.png||class="img-thumbnail" height="231" width="300"]]
201 +[[image:HMI Lua Editor user manual_html_e6807eb0da0eedd4.png||height="231" width="300" class="img-thumbnail"]]
202 202  
203 203  we_scr_init_0(): execute this function when screen 0 is initialized
204 204