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

Hi Christoph,

I hope you are fine and doing well.

I have downloaded AsTCP code from github website and I have created one embedded card for machine through which I can make the machine start or stop, but right now I am facing issue when I am getting online with 4PPC70 display to monitor the input / output of tags which I define in As TCP code.

Please suggest how to resolve the issue.

I would really appreciate your efforts for resolving the above issue.

Thanks & Regards,
Shrenik

Hi Shrenik,
I have seen that you have already created a new, more suitable topic for this, which is correct. So we should end here.

Hi Christoph,

Thanks for replying but I have used the code which was available on GitHub and in that code I am facing an issue for reading / writing the data from embedded card.

So please requesting you to look into this matter and let me know to resolve the issue.

Thanks & Regards,
Shrenik

Yes Christoph,

That is the one for which i am looking for solution.

Thanks & Regards,
Shrenik

Hi
Is there a way i could have ASP files in an external directory other than user partiiton with in the cpu… how to route external directory for examble My X20 CPU is 192.168.1.10 and am having html , ASP files in a service pc with ip address 192.168.1.11 at specified location

Dear Muthuvel,

As you have insert the html / ASP file in the root directory of PLC cpu and then you can access that file through web browser.

Using ftp server you can place that ASP file in the memory of CPU.

Thanks & Regards,
Shrenik

1 Like

Hi Shrenikec , Yes i do agree and its working as expected … since this concept was introduced in to older series of machine where User Partition is unused and further feel this process could get missed out in case of future changes

Hi Muthuvel and welcome to the community !

Well, the USER partition is the best location for the web server since you can always ensure this file device will exist.
Secondly the USER partion can be transferred with the project by Automation Studio.

The question is: will the web server run on any other file device than CF.

My first thought was to use an USBStick and use /bd0 for file device name. Unfortunately I could not get it to run.
So I have to pass your question to another brain.