Integrated webserver

Hi to all,

I am using 4PPC70,7" display for my project and I have activated webserver in the project, I have created simple html page & loaded the page through ftp in the controller.

But I am not able to read the value from the controller.

I would really apperciate to resolve my issue.

Thanks & Regards,
Shrenik
html error

Hi,
I’m sorry but the provided information is very little and it is hard to resolve the issue using this information.
Most likely lies the used path of the website, since it is “file:///D:/…” which is not an address from the PLC. I would expect “localhost/…” or “10.0.0.1/…” or anything similar.

Please check out the samples from the Automation Help regarding the websever and how to interact with the process variables.

BR Fabian

Hi,
As Fabian mentioned: you have to use your html file on the AR web server not as a local file.
Just have a look into GitHub - hilch/br-plc-as-webserver: Demo: use a B&R plc as a web server how to play with the built-in web server.

Dear Christoph,

Thanks for your reply.

As i have downloaded the project from github and done the same settings in my project but not able to read the value from the webpage.

Kindly refer the below html code which i have written to read the plc tag.

SHREENATHJI INDUSTRIES

WARP DATA

COUNT: <%ReadPLC("Count1");%>

This are settings which I have done in my project.

Let me know where is my mistake in the html page to read the value.

I would really appericate the efforts to resolve the above mention issue.

Thanks & Regards,
Shrenik

Hi Shrenik,

the settings are for a simulated PLC only.
I recommend you to use the ‘SAFE’ file system e.g. a ‘USER’ partition on your PLC:

image

then put all web files to a separate folder on this partition:

image

afterwards an ‘index.html’ in this folder become visible in your browser with http://<IP_ADDRESS_OF_C70>/index.html

First start without any ASP commands.
Then start here:

https://help.br-automation.com/#/en/4/visualization%2Fwebserver%2Fwebserver%2Fhome_file_asp.htm

With default ASP configuration you have to place the <%READPLC…> tags into a file which ends with ‘.asp’

Dear Christoph,
Sorry for delay response as I was out of station for machine works.

As I am able to open the html page in my browser but now i want to read the value of plc tags.

So to read the PLC tags should I have to create the another file with ASP commands and then link that file with my existing HTML file.

Let me know your thoughts for the same.

Thanks & Regards,
Shrenik

Happy New Year @shrenikec. Sorry for my late reply but was offline, too.

But you got it. A next step would be writing and HTML file, replace some contents with the ASP tags, rename it to .asp and link it with you index.html.

That is simple but would require refreshing the whole file to see a change of value. I prefer to store the ASP tags in *.asp files as JSON data and load them with fetch() (or XMLHttpRequest).

DEAR CHRISTOPH,

HAPPY NEW YEAR TO YOU DEAR.[quote=“Christoph Hilchenbach, post:7, topic:1467, full:true, username:christoph.hilchenbac”]
Happy New Year @shrenikec. Sorry for my late reply but was offline, too.

But you got it. A next step would be writing and HTML file, replace some contents with the ASP tags, rename it to .asp and link it with you index.html.

That is simple but would require refreshing the whole file to see a change of value. I prefer to store the ASP tags in *.asp files as JSON data and load them with fetch() (or XMLHttpRequest).
[/quote]

DEAR CHRISTOPH,

I HOPE YOU ARE FINE AND DOING WELL.

THANKS FOR GUIDANCE AND HAVE CREATED ASP PAGE IN WHICH I AM ABLE TO READ THE DATA FROM THE PLC.

THANKS & REGARDS,

SHRENIK

1 Like