Tires Processing using Lua Script FTP Client

1. Project Introduction

The project is for production lines for processing tires into crumbs. There is no Internet on site usually, but once a day an employee comes turns on the Wi-Fi distribution from his mobile phone and presses the button to send data to this server. Thus, the all archive files can be viewed by web server. The uploaded file type including Data record and Alarm record.

 图片1.png

图片2.png

图片3.png


2. Solution

Using the Lua Script to realize the FTP Client upload and download. We send the demo program, and customer integrates it into his own project.

图片4.png

 

3. Problem Encountered

3.1. Error prompt for "flash": When I saw this error first time, I originally thought customer changes the script content, so it would generate. I tell to the customer if he want to declare the flash path, please refer our Lua manual. The root path of flash is describe as "user" in Lua. But customer said it didn’t solve his issue. And then after we understand the customer is using the PI3000i models to test. So I suggest him to switch to the ig series HMI, due to the other models cannot support FTP function.

 

图片5.png


3.2. Customer don’t have the ig HMI in stock right that moment, so he want us to test the same function on PI3000i-N: We have a new function for upgrade the old HMI models into HMI System V2.0(V2.0 means the bottom layer code is same to the ig series, in other words, after upgrade, the PI3000i can also use the FTP function), and I tested successfully in PI3102i after upgrade the system. So I suggest customer to upgrade as well. After customer upgrade, he also have a feedback for goood result.

 

3.3. HMI doesn’t write file correctly into UDisk when download from FTP Server: I checked the Lua code, because in orginal demo program, function of FTP download is a fixed file name "udisk:smtp.jpg", so whatever file and how many times download, he just able to see the signle one file "smtp.jpg" exists in the root path of Udisk. So I change the function, the downloaded file would be the same name as customer input in the Download field.

 

 图片6.png


4. Summary

Understand more well about the entire FTP Lua code through this project. And remember to verify the FTP connection via 3rd party tool(For example FileZilla).


Engineering Video and Machine Pictures