Tutorial-3 - Webserver
Tutorial-3 - Webserver
TUTORIAL N°3
S7-1500 Webserver
I. OBJECTIVE
At the end of this tutorial, the student will be able to perform basic webserver configurations
on S7-1500 and S7-1200.
II. EQUIPMENT
The following table shows the minimum software and hardware requirements that have to be
met for the installation:
Hardware/software Requirement
RAM 8 GB
Operating systems
Windows 10 (64-bit)
Windows 11 (64-bit)
Windows Server (64-bit)
Hardware components
Software components
1
Software tool for creating 1 - Web pages created
HTML files such as with Notepad++
FrontPage, Notepad++, …
Web browser such as 1 - Created and tested
Internet Explorer, Mozilla with IE11 and Firefox
Firefox
III. OPERATIONS
1. Introduction
1.1. SIMATIC Web Server
The SIMATIC Web Server is a feature provided by Siemens for their SIMATIC S7-1200 and
S7-1500 programmable logic controllers (PLCs). It allows users to remotely access and
interact with their PLCs and automation systems through a web browser.
With the SIMATIC Web Server, you can perform various tasks such as:
Data logging: Recording and monitoring data from the PLC.
Modifying tags: Changing the values of different tags within the PLC.
Changing the operating state: Switching the PLC between different operating modes.
2
2. Creating HTML code
2.1. Creating index.html
We will use Microsoft Visual Studio Code to create our HTML code:
1. First, we create a folder for our code
2. We create a new file and name it index.html
3. Insert an exclamation mark: (!) and hit enter, lines of generic code show up
Here, we can change the webpage title, and insert tags in the body
4. We can insert a division <div> … </div> in the body, which contains a text, for
instance: Hello world.
3
2.2. Creating Styles
6. Basics on Cascading Style Sheets (CCS) is a formatting language for HTML elements.
With the help of style sheets, for example, font, font size, colors, border, height, width
etc. are specified for HTML elements.
To do the styling, we insert a new folder (CSS) and a new file style.css
4
8. We then insert this style in the tags:
10. To refresh the webpage, we insert the following code in the head section
11. To refresh only tags, we should utilise the Jquery from JavaScript (open
https://code.jquery.com/jquery-3.7.1.min.js) then save this webpage in the HTML code
directory.
12. Under the body we insert a Jscript, first we start by calling our jquery library:
5
13. We, then, add a new data storing page directory (DATA) and a new file (data.html)
14. We insert a new class cl1 containing our variable in the body of the code as follow
6
16. We insert a new directory and a new file: JS/script.js
Here every 200 ms the data from cl1 (data.html) will be loaded on cl2 (index.html)
7
2.4. Writing inputs on webpages
19. To write inputs on our webpage, first we put a comment at the very beginning of the
code containing the input variable name
20. Then, we specify the variable on the body by putting the style, the type and the name
of the variable.
21. To have the input variable shown on the webpage, we must add value command
22. To write a Boolean input on our webpage, first we put a comment at the very beginning
of the code containing the input variable name
<form id="mystyle">
<input type="submit" value="ON"/>
<input type="hidden" name='"Block_1_DB".M_bool' value="1"/>
</form>
8
24. To make a button with Boolean 0 we write two input commands:
<form id="mystyle7">
<input type="submit" value="OFF"/>
<input type="hidden" name='"Block_1_DB".M_bool' value="0"/>
</form>
25. We can put the style id directly on the input to have more style settings
<form >
<input id="mystyle" type="submit" value="ON"/>
<input type="hidden" name='"Block_1_DB".M_bool' value="1"/>
</form>
setInterval(function(){$('.LED_cl').load("data.html .cl3")},200);
29. We insert then the class LED_cl on the index.html with StyleLed id
function light(sw){
var LED
if (sw==0) {
LED="Images/63_pl-red-srx-3d.ac91e0a0ce.png"
}
else {LED="Images/62_pl-green-srx-3d.c22fd582ae.png"
}
9
document.getElementById("MyImg").src = LED;
}
35. Finally, we should call our PLC tag every 200 ms (setInterval) from data.html /
Mydata/MyId, then we apply the if condition on it by applying the light function
setInterval(function(){
document.getElementById("Mydata").src="data.html"
var Value =
document.getElementById("Mydata").contentWindow.document.getElementById("My
Id").innerHTML;
light(Value);
},200);
10
• Configure screens and screen objects.
• Configure dynamization.
• Compile the VoT application.
• Load the VoT application onto the PLC.
• Open the VoT application in the web control.
11
Then click on the link to the VoT application, you will be redirected to the WinCC Unified View-
of-Things
After logging into the VOT webpage, the user will be able to visualize and manipulate data.
12
REFERENCES
1. OPC ua.net client for S7-1500 master
2. OPC UA .NET Client for the SIMATIC S7-1500 OPC UA Server
3. https://www.youtube.com/@AutomationSet
TIA Portal web Server
13