Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

WebIQ JS scripts for accesing files saved on CtrlX HMI.

WebIQ JS scripts for accesing files saved on CtrlX HMI.

PrzemekGabrych
Occasional Visitor

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

3 REPLIES 3

webiq-sk
Frequent Contributor

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? 

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.

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.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist