Changes for page 05 Lua Script

Last modified by Devin Chen on 2025/03/04 14:07

From version 62.1
edited by Joe
on 2024/10/15 14:01
Change comment: There is no comment for this version
To version 49.1
edited by Devin Chen
on 2023/08/17 18:36
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.joe
1 +XWiki.DevinChen
Content
... ... @@ -36,18 +36,10 @@
36 36  
37 37  = **7 FTP Client** =
38 38  
39 -The example shows how  to establish the FTP server at WIN10 OS and make V2.0 HMI as FTP client.
39 +The example shows how the to establish the FTP server at WIN10 OS and make the HMI as FTP client.
40 40  
41 41  [[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/FTP%20ClientV2.zip]]
42 42  
43 -(% class="box infomessage" %)
44 -(((
45 -Note: The above demo can work normal in OS V2.0. But if HMI OS  is V3.0, please change "r+" to "r" in the script.
46 -)))
47 -
48 -(% style="text-align:center" %)
49 -[[image:dZyxVCtWDz.png]]
50 -
51 51  ~1. About how to set up the FTP server in Windows PC: **[[Build an FTP Site on IIS>>https://docs.microsoft.com/en-us/iis/publish/using-the-ftp-service/scenario-build-an-ftp-site-on-iis]] **,** [[How to set up and manage an FTP server on Windows 10>>https://www.windowscentral.com/how-set-and-manage-ftp-server-windows-10]]**
52 52  
53 53  2. Enter PC (FTP Server) IP address and port number (Default 21).
... ... @@ -75,48 +75,11 @@
75 75  (% style="text-align:center" %)
76 76  [[image:LuaFTPDemoInitial.png]]
77 77  
78 -(% class="box infomessage" %)
79 -(((
80 80  ✎Note: If want to confirm whether it is downloaded successfully, please add a File list object to check in HMI project. If saved path is root path (same to the all three drive), please set the folder as "~/~/".
81 -)))
82 82  
83 83  (% style="text-align:center" %)
84 84  [[image:LuaFTPDemoFilelist.png]]
85 85  
86 -**Common error:**
87 -
88 - In the demo project, if there are some errors in HMI for testing, please check the following steps.
89 -
90 -Error 1: 550 Access is denied
91 -
92 -Open Windows Settings → Update & Security→ Windows Security→ Firewall & network protection→ Advanced setting→ Inbound Rules→ New Rules→ Next → choose "This program path"→ input ‘’C:\Windows\System32\svchost.exe‘’→ Click “NEXT” continuously
93 -
94 -(% style="text-align:center" %)
95 -[[image:qCzqnKTUhp.png]]
96 -
97 -(% style="text-align:center" %)
98 -[[image:vfrt3NElMX.png]]
99 -
100 -(% style="text-align:center" %)
101 -[[image:dAuz25bdvM.png]]
102 -
103 -(% style="text-align:center" %)
104 -[[image:rxQIJkX8ll.png]]
105 -
106 -(% style="text-align:center" %)
107 -[[image:vmG8WGu5P2.png]]
108 -
109 -
110 -Error 2: No route to host
111 -
112 -The previous steps are the same as Error 1 → Port → specific local ports→ input port number “21”→ Click “NEXT” continuously
113 -
114 -(% style="text-align:center" %)
115 -[[image:fdsxie8WHc.png]]
116 -
117 -(% style="text-align:center" %)
118 -[[image:4ALQq7niTV.png]]
119 -
120 120  = **8 Telegram Notification** =
121 121  
122 122  The example shows how to use Bot API to push the notification to channel or group of Telegram. Please change the Token and Chat id to users' own one.
... ... @@ -596,7 +596,7 @@
596 596  
597 597  [[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/Number%20to%20string.zip]]
598 598  
599 -Note:This demo converts a 64-bit floating to a string,you can change the data format of "@W_HDW0" depand on requirements
554 +Note:This demo converts a 64-bit floating to a string,you can change the data format depand on requirements
600 600  
601 601  The core code is from file convert.lua:
602 602  
... ... @@ -607,45 +607,3 @@
607 607  
608 608  (% style="text-align:center" %)
609 609  [[image:Converttestdisplay.png]]
610 -
611 -= 19 HUAWEI CLOUD & OpenCloud =
612 -
613 -About the details, please check the powerpoint or video of Lua MQTT & OpenCloud [[Jump To>>doc:PIStudio.Download.1 Manual.WebHome]]
614 -
615 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/HuaweiMQ%281%29.zip]]
616 -
617 -= 20 UDP Multicast =
618 -
619 -The example shows how to use UDP multicast feature to send and receive data.
620 -
621 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/UDP%20Multicast.zip]]
622 -
623 -About the details, please check the [[UDP module>>https://docs.we-con.com.cn/bin/view/PIStudio/09%20Lua%20Editor/Lua%20Script/#HUDPmodule-1]]
624 -
625 -= 21 ATC module **send SMS** =
626 -
627 -The example shows how to use HMI to customize communication with the ATC SMS module via Lua script to send SMS.
628 -
629 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/SMS.zip]]
630 -
631 -= 22 TCP Client =
632 -
633 -The example shows how to use the Lua Socket TCP module to connect with a TCP server.
634 -
635 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/TCP%20ClientV1.1.zip]]
636 -
637 -~1. Set the initial values of Server IP and port number.
638 -
639 -(% style="text-align:center" %)
640 -[[image:vcbt6CE6EL.png]]
641 -
642 -2. Set the actual receive length of TCP message according to the actual needs.
643 -
644 -(% style="text-align:center" %)
645 -[[image:tPN1mbz7ny.png]]
646 -
647 -= 23 Lua SMS =
648 -
649 -The example shows how to use HMI built-in 4G module to send SMS via Lua script. This demo requires the HMI model name with (G) or (AG).
650 -
651 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/Lua%20SMS%20Library.zip]]
1721298723226-463.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Hunter
Size
... ... @@ -1,1 +1,0 @@
1 -33.9 KB
Content
4ALQq7niTV.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.joe
Size
... ... @@ -1,1 +1,0 @@
1 -20.7 KB
Content
dAuz25bdvM.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.joe
Size
... ... @@ -1,1 +1,0 @@
1 -245.8 KB
Content
dZyxVCtWDz.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.joe
Size
... ... @@ -1,1 +1,0 @@
1 -53.7 KB
Content
fdsxie8WHc.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.joe
Size
... ... @@ -1,1 +1,0 @@
1 -22.4 KB
Content
qCzqnKTUhp.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.joe
Size
... ... @@ -1,1 +1,0 @@
1 -30.0 KB
Content
rxQIJkX8ll.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.joe
Size
... ... @@ -1,1 +1,0 @@
1 -22.1 KB
Content
tPN1mbz7ny.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Hunter
Size
... ... @@ -1,1 +1,0 @@
1 -59.4 KB
Content
vcbt6CE6EL.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Hunter
Size
... ... @@ -1,1 +1,0 @@
1 -33.9 KB
Content
vfrt3NElMX.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.joe
Size
... ... @@ -1,1 +1,0 @@
1 -234.9 KB
Content
vmG8WGu5P2.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.joe
Size
... ... @@ -1,1 +1,0 @@
1 -22.1 KB
Content