FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
06-21-2023 10:43 AM
Hello!
I am new to Smart HMI. Is there any way to access files from ctrlX HMI script in WebIQ? The main goal is to get let's say data.csv file, validate the name of a file and get everything whats inside. Additionally reverse process so writing some data into specific csv file.
Regards
Solved! Go to Solution.
06-21-2023 11:14 AM
I don't understand "from ctrlX HMI script" - can you please explain exactly what you mean?
Also, where does that data.csv file come from? Is it available on the server, should the user be able to upload it?
06-21-2023 11:28 AM
I have an Android panel (Bosch Rexroth, ctrlX HMI), and let's say in a Downloads directory I have a "data.csv" file. I want to write a script that will be able to read this file name and everything that's inside.
06-21-2023 11:55 AM
I don't know if this would be possible to run on that Android panel, but on a normal Linux or Windows system you could create a simple NodeJS script (JavaScript) that would spin up its own web server and allow reading of that file via sending HTTP requests from the HMI to your NodeJS web server script that would then send the data back to the HMI user.
Please note that this way you should only implement writing files when all clients that are able to access the system from the network are completely locked down as otherwise potentially everyone with network access to your NodeJS server could write to that file.
However, first of all I would check with Bosch Rexroth if executing arbitrary NodeJS files that runs as servers is actually possible on these devices.
Please note that WebIQ Server does not support Android, only Windows and Linux. So you can use an Android Panel to display the HMI - as long as the browser is supported - but WebIQ Server (Runtime) has to be run on another system.
Websites in general cannot access local data without the user uploading it explicitly.