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)
-
Attachments (0 modified, 0 added, 3 removed)
Details
- Page properties
-
- Content
-
... ... @@ -301,10 +301,8 @@ 301 301 302 302 The example shows how to parse value from HTTP response body, and display into HMI internal address. The test forecast official website is [[https:~~/~~/www.weatherapi.com/>>url:https://www.weatherapi.com/]] 303 303 304 - [[Downloadlink>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/luahttp.zip]]304 +From the API document, the one day forecast response would be like the follows: 305 305 306 -From the API explorer of weatherapi, the one day forecast response would be like the follows(Because the original data of JSON is very long, there we just show the part of it): 307 - 308 308 {{code language="JSON"}} 309 309 { 310 310 "location": { ... ... @@ -513,18 +513,4 @@ 513 513 } 514 514 {{/code}} 515 515 516 -The core code is from file API_WEATHER.lua, and function name is get7DayWeatherapiByCityname. 517 - 518 -(% style="text-align:center" %) 519 -[[image:WeatherHTTPAPI.png]] 520 - 521 -The HMI offline simulator result: 522 - 523 -(% style="text-align:center" %) 524 -[[image:WeatherHTTPtestdisplay.png]] 525 - 526 -= 17 **CSV File Reading** = 527 - 528 -The example shows how to read the csv file into HMI, and then display as table. 529 - 530 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/csvRead.zip]] 514 +[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/luahttp.zip]]
- 1688968905886-196.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Hunter - Size
-
... ... @@ -1,1 +1,0 @@ 1 -26.5 KB - Content
- WeatherHTTPAPI.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Hunter - Size
-
... ... @@ -1,1 +1,0 @@ 1 -55.9 KB - Content
- WeatherHTTPtestdisplay.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Hunter - Size
-
... ... @@ -1,1 +1,0 @@ 1 -36.2 KB - Content