Changes for page 05 Lua Script
Last modified by Devin Chen on 2025/03/04 14:07
From version 28.1
edited by Theodore Xu
on 2023/04/11 17:24
on 2023/04/11 17:24
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Attachments (0 modified, 5 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. AiXia1 +XWiki.Hunter - Content
-
... ... @@ -243,4 +243,49 @@ 243 243 244 244 = **12 Week time setting** = 245 245 246 +The example shows how to use day time to control functions: 247 + 246 246 [[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/week%20time.zip]] 249 + 250 += **13 MQTT Multi-link** = 251 + 252 +The example shows use mqtt realize multi-machine function: 253 + 254 +[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/MQTT%20Multi-link.zip]] 255 + 256 += **14 CSV File Generation** = 257 + 258 +The example shows convert the custom lua table data into csv string, then output as a file: 259 + 260 +[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/csvGenerate.zip]] 261 + 262 +The following steps take HMI simulator as example: 263 + 264 +~1. Click button "Create Table" to draw lua table in screen. 265 + 266 +(% style="text-align:center" %) 267 +[[image:csvGenerateSteps.png]] 268 + 269 +2. Click button "Save as csv" to save the file into HMI storage path. On the HMI simulator, user can enter the simulation path of U disk to check the file whether create successfully. 270 + 271 +(% style="text-align:center" %) 272 +[[image:csvGenerateSimulationPath.png]] 273 + 274 +3. Click button "upload" to upload csv file into server side. In this case, we can check the upload path for PC. 275 + 276 +(% style="text-align:center" %) 277 +[[image:csvGenerateServerPath.png]] 278 + 279 +The csv file generation is mainly using the following function to implement, the customized data is argument tab, and csv file storage path in HMI is "udisk:weather1.csv": 280 + 281 +(% style="text-align:center" %) 282 +[[image:csvGenerateLuaCode.png]] 283 + 284 +The table drawing is mainly using the following function to implement: 285 + 286 +(% style="text-align:center" %) 287 +[[image:csvLuaTableDrawing.png]] 288 + 289 += 15 **String customized word-wrapped** = 290 + 291 +[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/CRLF.zip]]
- csvGenerateLuaCode.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Hunter - Size
-
... ... @@ -1,0 +1,1 @@ 1 +50.2 KB - Content
- csvGenerateServerPath.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Hunter - Size
-
... ... @@ -1,0 +1,1 @@ 1 +56.3 KB - Content
- csvGenerateSimulationPath.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Hunter - Size
-
... ... @@ -1,0 +1,1 @@ 1 +29.7 KB - Content
- csvGenerateSteps.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Hunter - Size
-
... ... @@ -1,0 +1,1 @@ 1 +32.5 KB - Content
- csvLuaTableDrawing.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Hunter - Size
-
... ... @@ -1,0 +1,1 @@ 1 +43.9 KB - Content