Changes for page 05 Lua Script
Last modified by Devin Chen on 2025/03/04 14:07
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -90,7 +90,7 @@ 90 90 91 91 This example shows how to parse value from subscribing MQTT topic. Get the value and calculate the average value for group F1, F2, F3 and F4. The testing topic name is "testtopic/test/no1/123456". 92 92 93 - [[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/MQTT%20JSON%20parse.zip]]93 +Download link 94 94 95 95 And the subscribed content is like following: 96 96 ... ... @@ -227,36 +227,4 @@ 227 227 (% style="text-align:center" %) 228 228 [[image:MQTTJSONparsefunction.png]] 229 229 230 -= **11 High-Low Byte Switch** = 231 - 232 -The example shows how to convert high bytes and low bytes for one 16bit address. Main function is like following: 233 - 234 -{{code language="lua"}} 235 -local lowByte = val & 0x00ff 236 -local shiftHigh = lowByte << 8 237 -local highByte = val & 0xff00 238 -local shiftLow = highByte >> 8 239 -local newVal = shiftHigh|shiftLow 240 -{{/code}} 241 - 242 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/byteswitch.zip]] 243 - 244 -= **12 Week time setting** = 245 - 246 -The example shows how to use day time to control functions: 247 - 248 -[[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 lua table data into csv string, then output as a file: 259 - 260 -~1. Click "Create Table" to draw the lua table into HMI 261 - 262 262