Web server
Web server
S7-1500) 1
Manual
V20
11/2024
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as
well as to prevent damage to property. The notices referring to your personal safety are
highlighted in the manual by a safety alert symbol, notices referring only to property damage
have no safety alert symbol. These notices shown below are graded according to the degree of
danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest
degree of danger will be used. A notice warning of injury to persons with a safety alert symbol
may also include a warning relating to property damage.
Qualified Personnel
WARNING
Siemens products may only be used for the applications described in the catalog and in the
relevant technical documentation. If products and components from other manufacturers are
used, these must be recommended or approved by Siemens. Proper transport, storage,
installation, assembly, commissioning, operation and maintenance are required to ensure
that the products operate safely and without any problems. The permissible ambient
2 Manual, 11/2024
conditions must be complied with. The information in the relevant documentation must be
observed.
Trademarks
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and
software described. Since variance cannot be precluded entirely, we cannot guarantee full
consistency. However, the information in this publication is reviewed regularly and any
necessary corrections are included in subsequent editions.
Siemens Aktiengesellschaft
Copyright © Siemens 2024.
Digital Industries
11/2024 Subject to change All rights reserved
Postfach 48 48
90026 NÜRNBERG
GERMANY
Manual, 11/2024 3
Table of content
4 Manual, 11/2024
Manual, 11/2024 5
WWW: Synchronizing user pages (S7-1200, S7-1500)
Initialization
User web pages are "packaged" in data blocks for processing by the CPU. You will have to
generate appropriate data blocks from the source files (HTML files, screens, Javascript files, ...)
during configuration. The Web Control DB takes on a special role (default: DB 333). It contains
status and control information as well as links to additional data blocks with coded web pages.
The data blocks with coded web pages are called fragment DBs.
When the data blocks are downloaded into the CPU, the CPU does not "know" that user web
pages are coded inside it. The instruction "WWW" in the startup OB, for example, will inform the
CPU which DB is the Web Control DB. After this initialization, the user pages are accessible via a
web browser.
Synchronization
If you want the user program to interact with the user pages, then the instruction "WWW" must
be used in the cyclical program part.
Examples of interaction between user program and web page:
Assemble and send back data to the web browser making the request
In this case it must be possible to evaluate the current status information and the Web server
must receive control information, such as release of a web page requested by a web browser.
Parameter
The following table shows the parameters of the "WWW" instruction:
6 Manual, 11/2024
CTRL_DB Input DB_WWW I, Q, M, D, L or Data block that describes the user
constant pages (Web control DB)
You can find additional information on valid data types under Overview of the valid data types.
Parameter RET_VAL
(W#16#...)
0000 No error occurred. There are no web page requests that have to be
released by the user program.
00xy x: indicates whether an error has occurred during initialization of the Web
Control DB (CTRL_DB):
x=0: No errors occurred.
x=1: Error occurred. The error is coded in the byte "CTRL_DB.last_error" of
the Web Control DB, see description of Web Control DB.
y: Number of the pending request. Several requests are possible (e. g.
requests "0" and "1" are pending: y="3".
y="1": Request "0"
y="2": Request "1"
y="4": Request "2"
y="8": Request "3"
803A The specified Web Control DB does not exist on the CPU.
8083 User-defined web pages (user-defined pages) are not enabled for the
communication with the web server. Only the web-based API (Web API)
and web applications based on it are released.
80C1 There are no resources to initialize the web application, for example,
because only two or four web applications may be running.
Example
You will find the example here: Program example of WWW.
See also
Manual, 11/2024 7
Overview of the valid data types
What you need to know about user pages (S7-300, S7-400, S7-1500)
Sample Library for Instructions (S7-1200, S7-1500)
Introduction
In the following example, you synchronize a user-defined Website with the program example in
a CPU S7-1500 and test the program example via a Web server.
Requirement
Create nineteen tags in a global data block for storing the data.
8 Manual, 11/2024
Network 2: You create the program for the Website in the FC “SLI_FC_MainWebProg_www“. You
then call the FC “SLI_FC_MainWebProg_www“ in network 2 of the FB.
Network 2: This is followed by interconnecting the tags for setting the time-of-day interrupt OB.
The local tag “#startDateTime“ (data type “Date_And_Time”) transfers the start time to the time-
of-day interrupt OB.
Network 3: This is followed by interconnecting the tags for activating the time-of-day interrupt
OB.
Manual, 11/2024 9
Interconnecting parameters - in the OB “SLI_todOB_www“
In the time-of-day interrupt OB “SLI_todOB_www“ (OB11) you create the following
interconnections for cyclic increasing of the tag “tankLevel“.
Network 2: This is followed by interconnecting the tags for opening the valve.
Network 3: This is followed by interconnecting the tags for starting the motor.
10 Manual, 11/2024
Network 4: This is followed by interconnecting the tags for querying the interrupt status “1“.
Networks 5 to 8: This is followed by interconnecting the tags for querying the interrupt status
“2“.
Interconnect the tags for querying the other interrupt statuses in the same way.
Network 9: This is followed by interconnecting the tags for resetting the motor and the filling of
the tank..
Network 10: This is followed by interconnecting the tags for resetting all the other values
(BOOL).
Manual, 11/2024 11
Setting CPU properties
Make the following settings in the CPU properties:
Activate web server access under "... > PROFINET interface > Access to the web server".
In “CPU properties > Web server enable the Web server for the module,
In the section “User administration“ create a new user with read and write rights.
Note
The storage path should be the same as the path of the Sample Library for
Instructions (SLI). The folder name is “SLI_html“. For example:
“C:\TIA\_library\SLI_html“.
- Click the "Create block" button. The Web DB (333) and the Fragment DB (334) are then
created.
12 Manual, 11/2024
Result for the Web server
You call the Web server via the “Internet browser > IP of the Web server”. You log in with your
user name user name and -password.
In the Web server in “User pages” a link to the website defined by the user is displayed.
On the Website of the program example it is possible for you to output tags and transfer new
values to the tags.
Manual, 11/2024 13
Functions used in the HTML document
Below you will see excerpts of the functions used in the program example with which the tags
are transferred to the source code in the HTML document. For each function a tag is
implemented via a call in the HTML document and at the relevant location in the HTML
document is used with a further call.
14 Manual, 11/2024
Enumeration <!-- AWP_Enum_Def <!-- AWP_Enum_Ref
(value Name="OpValvValue" Name='"SLI_gDB_www".valveOutput'
replacement): Values='0:"Closed", 1:"Opened"' - Enum="OpValvValue" --
-> >:="SLI_gDB_www".valveOutput:
See also
Sample Library for Instructions (S7-1200, S7-1500)
Manual, 11/2024 15