FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
05-17-2024 10:50 AM - last edited on 05-21-2024 09:04 AM by HmiGuide
I have a html page that analyze the .npg file and render the points. It works fine without webiq, but when I am trying to add this html to the project I am only can choose the file to read and that's all. What the problem might be? I've attached zip which contains webiq project zip, html page and .npg file.
Solved! Go to Solution.
05-17-2024 12:13 PM
Please note that the HTML tag simply embeds HTML code into the page - it is not intended to insert complete HTML documents - this will actually result in invalid HTML code (you then have multiple HEAD, DOCTYPE, BODY tags in the page which is not allowed in HTML) - only parts between the opening and closing BODY tag can be used, i.e. HTML code/elements, not documents.
Instead you can get it working by following best practises here:
1. You already have a complete HTML document you want to embed
2. Simply embed it using the iFrame widget:
a) In the closed and unpacked project directory add the "New.html" to the main directory, i.e. the same one that webiq.json, index.html etc. are in
b) Load this modified project and delete the HTML widget in the HMI
c) Add an iFrame element and set the URL to "New.html" (excluding the quotation marks)
Then it will work. Why it didn't work I don't know but when working with web technology and especially JavaScript you should familiarize yourself with JavaScript debugging.
05-17-2024 02:45 PM
I have one more question: is that possible to send opcua vars into iFrame which launch custom HTML page?
05-17-2024 03:27 PM
Your question is not specific to WebIQ per se, but rather a web development question you can find a lot of info and examples online, e.g. here:
When it comes to reading item values in an HMI with JavaScript have a look at the scripting demo which contains a lot of examples.