s71500 Webserver Function Manual en-US en-US
s71500 Webserver Function Manual en-US en-US
FUNCTION MANUAL
SIMATIC
S7-1500, ET 200SP, ET 200pro
Web server
support.industry.siemens.com
Introduction
1
11/2023
A5E03484625-AK
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
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions.
Qualified personnel are those who, based on their training and experience, are capable of identifying risks and
avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
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 conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
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.
1 Introduction........................................................................................................................................ 8
1.1 Function manuals documentation guide........................................................................... 15
1.1.1 Information classes Function Manuals............................................................................... 15
1.1.2 Basic tools........................................................................................................................ 17
1.1.3 SIMATIC Technical Documentation.................................................................................... 19
3 General information........................................................................................................................... 22
3.1 Properties of the Web server............................................................................................. 22
3.2 Configuring the Web server............................................................................................... 26
3.3 Certificate......................................................................................................................... 30
3.3.1 Web server certificates...................................................................................................... 30
3.3.2 Managing certificates via TIA Portal................................................................................... 31
3.3.3 Managing certificates in runtime....................................................................................... 33
3.4 Language settings............................................................................................................. 37
3.5 User management............................................................................................................ 39
3.6 Updating and saving information...................................................................................... 46
4 Web pages.......................................................................................................................................... 47
4.1 Start page with general CPU information........................................................................... 47
4.2 Diagnostics....................................................................................................................... 54
4.3 Diagnostics buffer............................................................................................................. 63
4.4 Motion Control diagnostics............................................................................................... 64
4.5 Module information.......................................................................................................... 69
4.6 Firmware update.............................................................................................................. 74
4.7 Alarms.............................................................................................................................. 76
4.8 Communication................................................................................................................ 78
4.9 Topology.......................................................................................................................... 84
4.9.1 Introduction..................................................................................................................... 84
4.9.2 Graphical view.................................................................................................................. 85
4.9.3 Tabular view..................................................................................................................... 88
4.9.4 Status overview................................................................................................................ 90
4.9.5 Examples for graphical topology views.............................................................................. 90
4.10 Tag status......................................................................................................................... 93
4.11 Watch tables..................................................................................................................... 95
4.12 Online backup.................................................................................................................. 97
Web server
4 Function Manual, 11/2023, A5E03484625-AK
Table of contents
Web server
Function Manual, 11/2023, A5E03484625-AK 5
Table of contents
Web server
6 Function Manual, 11/2023, A5E03484625-AK
Table of contents
Glossary.............................................................................................................................................. 277
Index................................................................................................................................................... 281
Web server
Function Manual, 11/2023, A5E03484625-AK 7
Introduction 1
Purpose of the documentation
This documentation supports you in the operation of the Web server.
The Web server offers, among other things, web page access to diagnostic data and to
process data of the CPU.
Conventions
STEP 7: In this documentation, "STEP 7" is used as a synonym for all versions of the
configuring and programming software "STEP 7 (TIA Portal)".
Please also observe notes marked as follows:
NOTE
A note contains important information on the product described in the documentation, on
the handling of the product and on the section of the documentation to which particular
attention should be paid.
Web server
8 Function Manual, 11/2023, A5E03484625-AK
Introduction
What's new in the Web Server Function Manual, Version 11/2023 compared to Version 10/2022
What's new? What are the customer benefits? Where can I find information?
New contents New Web API methods Many new API methods extend your access You can find an overview of all
options to the CPU via the Web API. Web API methods in the section
Supported clients (Page 153).
Introduction of the local user You define and manage the users of CPUs in Section Configuring the Web
management for CPUs with a TIA Portal project. You assign roles and server (Page 26)
firmware version ≥ V3.1 rights to the users. The user accounts are
valid project-wide.
Changed con Scope of this function manual You can apply Web API methods on the Section API (Application Pro
tents expanded to include the R/H-CPUs. gramming Interface) (Page 153)
R/H-CPU of the redundant sys
tem S7-1500R/H
What's new in the Web Server Function Manual, Version 10/2022 compared to Version 05/2021
What's new? What are the customer benefits? Where can I find information?
New contents New Web API methods Many new API methods extend your access Section API (Application Pro
options to the CPU via the Web API. gramming Interface) (Page 153)
Management of certificates in In addition to loading Web server certific
runtime ates via the TIA Portal, this option makes it Section Managing certificates in
possible to provide such certificates from a runtime (Page 33)
certificate management server at runtime.
This allows you, for example, to update
expiring certificates in time without inter
rupting the process.
Motion Control Diagnostics (T Display of the diagnostics of the axis status Section Motion Control Dia
CPUs) for the "Encoder homed" signal of the gnostics (Page 64)
encoders of all 4 possible axes. Function manuals for
S7-1500/1500T Motion Control
on the Internet
(https://support.industry.
siemens.
com/cs/ww/de/view/109751049)
Changed con Extension of the scope of this Web server functions can now also be used • Equipment Manual CPU
tents function manual to the CPU on these CPUs. 1514SP-2 PN
1514SP-2 PN and the CPU (https://support.industry.
1514SPT-2 PN of the siemens.
ET 200SP distributed I/O sys com/cs/ww/en/view/109813
tem. 105)
• Equipment Manual CPU
1514SPT-2 PN
(https://support.industry.
siemens.
com/cs/ww/en/view/109813
106)
Web server
Function Manual, 11/2023, A5E03484625-AK 9
Introduction
What's new in the Web Server Function Manual, Version 05/2021 compared to Version 11/2019
What's new? What are the customer benefits? Where can I find information?
New contents New Web API methods: Reading and changing CPU operating mode Section Reading and changing
• Plc.ReadOperatingMode via Web API the operating mode (Page 206)
• Plc.RequestChangeOperat
ingMode
Ticket mechanism and ticket With the Web server as of firmware version Section Ticket mechanism (Page
methods for handling the V2.9, you can use the ticket mechanism of 164)
tickets: the Web API. You can use the ticket mech
• Api.BrowseTickets anism to transfer large amounts of data out
• Api.CloseTicket side of the JSON-RPC protocol.
The ticket mechanism is the basis for all file-
based methods, such as file upload/down
load of resources.
Web applications of the Web Web applications that can be loaded by the Section Web applications that
API that can be loaded by the user offer you the following major advant can be loaded by the user (Page
user: ages as of firmware version V2.9 compared 250)
Web applications that can be to the older method that provided the user-
loaded by the user provide defined pages via the system function SFC
you with an additional set of 99 in STEP 7:
methods to manage web Only the TIA Portal project in the
applications via Web API. SIMATIC.S7S directory on the SIMATIC
You can use all available Web Memory Card changes. Your TIA Portal
API methods within the web project is extended by the option of saving
application. resources (e.g. HTML, CSS, JavaScript, etc.)
in the project but outside of the data blocks
of the user program.
The resources are saved in the associated
web application. Via the Web API you can
download the resources to your PC, edit
them and upload them back to the CPU.
This procedure results in significantly
reduced development times of user-defined
pages.
You can access resources independent of
the CPU operating mode (e.g. RUN, STOP)
and update these.
Web applications are also available in the
STOP mode of the CPU.
Creating user-defined pages Compared to creating user-defined pages Section User-defined pages
with TIA Portal WinCC Unified with a random HTML editor, creating and (Page 124)
as of Version V17 loading user-defined pages with WinCC Uni WinCC Unified online help
fied for SIMATIC S7-1500 CPUs offers the
following advantages:
• No HTML code expertise required
• You can make changes to the user-
defined pages while the CPU is in the
RUN mode.
Web server
10 Function Manual, 11/2023, A5E03484625-AK
Introduction
What's new? What are the customer benefits? Where can I find information?
Changed con Diagnostics The display in the "Memory" tab is extended Section Diagnostics (Page 54)
tents by information on the data type memory so
that the user program can be changed
accordingly when the available memory is
not sufficient.
Motion Control Diagnostics Comprehensive diagnostic options for Section Motion Control Dia
Motion Control applications: gnostics (Page 64)
• Diagnostics information is available for
all technology objects
• Improved display and grouping of the
tags
Communication Extension of the "Parameter" tab to assign Section Communication (Page
the network configuration via a DHCP server 78)
and display the DNS settings
What's new in the Web Server Function Manual, Version 11/2019 compared to Version 12/2017
What's new? What are the customer benefits? Where can I find information?
New contents The CPU has a web-based API • Established standard mechanisms for Section API (Application Pro
(Application Programming creating web pages: gramming Interface) (Page 153)
Interface) as an interface for: Automation Web Programming com
• Reading and writing CPU mands (AWP commands) are no longer
data required for output of CPU data
• Executing functions (e.g. • No dependency between custom Web
backing up and restoring pages and CPU program:
the CPU configuration, No synchronization between user pro
changing the operating gram and Web server required by the
mode) SFC 99 instruction
The Web API supports all com • Lower communication load:
mon browsers and command A smaller data packet (JSON instead of
line programs, such as cURL HTML) of the custom web page gener
and Wget. ated by the CPU is transferred between
the server and the client. This improves
the communication performance. The
CPU needs less runtime to generate the
information and make it available.
• Secure data traffic:
the Web API only supports the transmis
sion protocol "HTTPS"
Changed con Extension of the scope of this Webserver functions which you are familiar • System Manual SIMATIC
tents function manual to the CPUs with from the CPUs of the SIMATIC S7-1500 Drive Controller
of the SIMATIC Drive Control can now also be used on the CPUs of the (https://support.industry.
ler SIMATIC Drive Controller. siemens.
com/cs/ww/en/view/109766
665)
• Equipment Manual SIMATIC
Drive Controller
(https://support.industry.
siemens.
com/cs/ww/en/view/109766
666)
Web server
Function Manual, 11/2023, A5E03484625-AK 11
Introduction
What's new in the Web Server Function Manual, Version 12/2017 compared to Version 09/2016
What's new? What are the customer benefits? Where can I find information?
New contents New web page "User files" You can download ASCII files (files in binary Section User files (Page 122)
format) from the SIMATIC Memory Card, dir
ectory UserFiles\ to the web page and delete
them.
Time display as Coordinated The display of the UTC allows you to use a Section Start page with general
Universal Time (UTC) or as uniform time for the web pages. CPU information (Page 47)
PLC local time You can set the format of the time display
to Coordinated Universal Time (UTC) or PLC
local time (default setting).
Automated downloading, You can, for example, read out and archive Section Automated reading out
reading out and archiving of DataLogs daily from one or more CPUs at a of DataLogs (Page 120)
DataLogs specific time via the Web server.
Automatic downloading of DataLogs is real
ized either by the execution of scripts in, for
example, Bash or via JavaScript on your
HTML user-defined page.
The "Permit access only with The web pages are transmitted by default Section Configuring the Web
HTTPS" check box is activated via a secure connection and are protected server (Page 26)
in the default setting of a con from attacks by third parties.
figured CPU.
Changed con Web page "Module You can read the assignment of the device Section Module information
tents information": New column number to the device name. (Page 69)
Device number
Web page "Topology": Selec You can select the topology display for the Section Topology (Page 84)
tion of the available PROFINET PROFINET interfaces X1, X2 and for connec
interfaces, for example X1, ted PROFINET communication modules.
X2, CM 1542-1
Web page "DataLogs": New You can delete DataLog files via the Web Section DataLogs (Page 119)
column for deleting DataLog server.
files
Web page "Record": Changes You can evaluate the Trace recordings in Section Record (Page 101)
in the display of Trace record more detail through the extension of the
ings display.
Web page "Record": New In the case of completed measurements you
arithmetic functions can combine the measured signals mathem
atically with each other and this generate
signals that were not recorded.
You can, for example, form the difference
of two signals in order to better display the
deviation of the current pressure of a boiler
from the set setpoint value.
Web server
12 Function Manual, 11/2023, A5E03484625-AK
Introduction
What's new in the Web Server Function Manual, Version 09/2016 compared to Version 12/2014
What's new? What are the customer benefits? Where can I find information?
New contents Handling of certificate modi You protect the Web server connection Section Configuring the Web
fied against tapping or distortion of the commu server (Page 26)
nication through access via the secure trans
mission protocol "HTTPS" including a special
Web server certificate.
Four additional languages for You can set the Web server interface to the Section Start page with general
the Web server interface following languages: CPU information (Page 47)
• Korean
• Russian
• Turkish
• Portuguese (Brazil)
Assignment of different You can assign up to three different project Section Language settings (Page
project languages extended languages for comments, alarm texts and 37)
diagnostics information to the user inter
face languages of the Web server.
"Start page" web page exten The display of the TIA project name immedi Section Start page with general
ded ately indicates whether the desired project CPU information (Page 47)
is selected.
"Diagnostics" web page exten Here you can find information about: Section Diagnostics (Page 54)
ded by one tab: • Know-how protection or copy protection
• "Program protection" of the PLC program
• "Runtime information" • Program/communication load and cycle
• "Fail-safe" (with an F-CPU) time
• F-collective signatures, cycle times and
runtimes of the F-runtime group(s)
"Alarms" web page extended You can acknowledge alarms of the CPU via Section Alarms (Page 76)
the Web server.
"Tag status" and "Watch You can change the value of tags and write • Section Tag status (Page 93)
tables" web pages extended them to the CPU, also using the absolute • Section Watch tables (Page
address. 95)
New web page "Online You can back up and restore the CPU config Section Online backup (Page 97)
backup" uration to/from the SIMATIC Memory Card
via the Web server.
New "Motion Control You can monitor statuses, errors, techno Section Motion Control dia
Diagnostics" web page logy alarms and the current values of con gnostics (Page 64)
figured technology objects (TOs) with the
Web server without STEP 7.
New "Record" web page You can read, view and save trace record Section Record (Page 101)
ings via the Web server and thus obtain
plant and project information for dia
gnostics and maintenance without STEP 7.
Changed con Extension of the scope of this Functions that you will be familiar with from • Equipment Manual CPU
tents function manual to the CPUs the SIMATIC S7‑1500 CPUs are implemented 1510SP-1 PN
of the ET 200SP distributed in CPUs in other designs (ET 200SP) and in (https://support.industry.
I/O system and the the CPU 1516pro‑2 PN (degree of protection siemens.
CPU 1516pro‑2 PN IP65, IP66 and IP67). com/cs/ww/en/view/901571
30)
Web server
Function Manual, 11/2023, A5E03484625-AK 13
Introduction
What's new? What are the customer benefits? Where can I find information?
Changed con • Equipment Manual CPU
tents 1512SP-1 PN
(https://support.industry.
siemens.
com/cs/ww/en/view/901570
13)
• Operating instructions CPU
1516pro-2 PN
(https://support.industry.
siemens.
com/cs/ww/en/view/109482
416)
Web page "Watch tables": Section Watch tables (Page 95)
Note added on the maximum configuration limits.
Web page "User-defined pages": Section User pages (Page 124)
Note added on the maximum size of the HTML pages.
Industry Mall
The Industry Mall is the catalog and order system of Siemens AG for automation and drive
solutions on the basis of Totally Integrated Automation (TIA) and Totally Integrated Power
(TIP).
You can find catalogs for all Automation and Drives products on the Internet
(https://mall.industry.siemens.com).
Web server
14 Function Manual, 11/2023, A5E03484625-AK
Introduction
1.1 Function manuals documentation guide
Basic information
The system manuals and Getting Started describe in detail the configuration, installation,
wiring and commissioning of the SIMATIC S7‑1500, SIMATIC Drive Controller, ET 200MP,
ET 200SP, ET 200AL and ET 200eco PN systems. Use the corresponding operating instructions
for 1513/1516pro-2 PN CPUs.
The STEP 7 online help supports you in the configuration and programming.
Examples:
• Getting Started S7-1500
• System manuals
• Operating instructions ET 200pro and 1516pro-2 PN CPU
• Online help TIA Portal
Device information
Equipment manuals contain a compact description of the module-specific information, such
as properties, wiring diagrams, characteristics and technical specifications.
Examples:
• Equipment manuals for CPUs
• Equipment manuals for interface modules
• Equipment manuals for digital modules
• Equipment manuals for analog modules
• Equipment manuals for communication modules
• Equipment manuals for technology modules
• Equipment manuals for power supply modules
• Equipment manuals for BaseUnits
Web server
Function Manual, 11/2023, A5E03484625-AK 15
Introduction
1.1 Function manuals documentation guide
General information
The function manuals contain detailed descriptions on general topics relating to the
SIMATIC Drive Controller and the S7-1500 automation system.
Examples:
• Function Manual Diagnostics
• Function Manual Communication
• Function Manuals Motion Control
• Function Manual Web Server
• Function Manual Cycle and Response Times
• PROFINET Function Manual
• PROFIBUS Function Manual
Product Information
Changes and supplements to the manuals are documented in a Product Information. The
Product Information takes precedence over the device and system manuals.
You will find the latest Product Information on the Internet:
• S7-1500/ET 200MP (https://support.industry.siemens.com/cs/de/en/view/68052815)
• SIMATIC Drive Controller
(https://support.industry.siemens.com/cs/de/en/view/109772684/en)
• Motion Control (https://support.industry.siemens.com/cs/de/en/view/109794046/en)
• ET 200SP (https://support.industry.siemens.com/cs/de/en/view/73021864)
• ET 200eco PN (https://support.industry.siemens.com/cs/ww/en/view/109765611)
Manual Collections
The Manual Collections contain the complete documentation of the systems put together in
one file.
You will find the Manual Collections on the Internet:
• S7-1500/ET 200MP/SIMATIC Drive Controller
(https://support.industry.siemens.com/cs/ww/en/view/86140384)
• ET 200SP (https://support.industry.siemens.com/cs/ww/en/view/84133942)
• ET 200AL (https://support.industry.siemens.com/cs/ww/en/view/95242965)
• ET 200eco PN (https://support.industry.siemens.com/cs/ww/en/view/109781058)
Web server
16 Function Manual, 11/2023, A5E03484625-AK
Introduction
1.1 Function manuals documentation guide
Tools
The tools described below support you in all steps: from planning, over commissioning, all
the way to analysis of your system.
Web server
Function Manual, 11/2023, A5E03484625-AK 17
Introduction
1.1 Function manuals documentation guide
PRONETA
SIEMENS PRONETA (PROFINET network analysis) is a commissioning and diagnostic tool for
PROFINET networks. PRONETA Basic has two core functions:
• In the network analysis, you get an overview of the PROFINET topology. Compare a real
configuration with a reference installation or make simple parameter changes, e.g. to the
names and IP addresses of the devices.
• The "IO test" is a simple and rapid test of the wiring and the module configuration of a
plant, including documentation of the test results.
You can find SIEMENS PRONETA Basic on the Internet:
(https://support.industry.siemens.com/cs/ww/en/view/67460624)
SIEMENS PRONETA Professional is a licensed product that offers you additional functions. It
offers you simple asset management in PROFINET networks and supports operators of
automation systems in automatic data collection/acquisition of the components used through
various functions:
• The user interface (API) offers an access point to the automation cell to automate the scan
functions using MQTT or a command line.
• With PROFIenergy diagnostics, you can quickly detect the current pause mode or the
readiness for operation of devices that support PROFIenergy and change these as needed.
• The data record wizard supports PROFINET developers in reading and writing acyclic
PROFINET data records quickly and easily without PLC and engineering.
You can find SIEMENS PRONETA Professional on the Internet.
(https://www.siemens.com/proneta-professional)
SINETPLAN
SINETPLAN, the Siemens Network Planner, supports you in planning automation systems and
networks based on PROFINET. The tool facilitates professional and predictive dimensioning of
your PROFINET installation as early as in the planning stage. In addition, SINETPLAN supports
you during network optimization and helps you to exploit network resources optimally and to
plan reserves. This helps to prevent problems in commissioning or failures during productive
operation even in advance of a planned operation. This increases the availability of the
production plant and helps improve operational safety.
The advantages at a glance
• Network optimization thanks to port-specific calculation of the network load
• Increased production availability thanks to online scan and verification of existing systems
• Transparency before commissioning through importing and simulation of existing STEP 7
projects
• Efficiency through securing existing investments in the long term and the optimal use of
resources
You can find SINETPLAN on the Internet
(https://new.siemens.com/global/en/products/automation/industrial-
communication/profinet/sinetplan.html).
Web server
18 Function Manual, 11/2023, A5E03484625-AK
Introduction
1.1 Function manuals documentation guide
Watch this short video to find out where you can find the overview directly in Siemens
Industry Online Support and how to use Siemens Industry Online Support on your mobile
device:
Quick introduction to the technical documentation of automation products per
video (https://support.industry.siemens.com/cs/us/en/view/109780491)
Web server
Function Manual, 11/2023, A5E03484625-AK 19
Introduction
1.1 Function manuals documentation guide
mySupport
With "mySupport" you can get the most out of your Industry Online Support.
Registration You must register once to use the full functionality of "mySupport". After registra
tion, you can create filters, favorites and tabs in your personal workspace.
Support requests Your data is already filled out in support requests, and you can get an overview of
your current requests at any time.
Documentation In the Documentation area you can build your personal library.
Favorites You can use the "Add to mySupport favorites" to flag especially interesting or fre
quently needed content. Under "Favorites", you will find a list of your flagged
entries.
Recently viewed The most recently viewed pages in mySupport are available under "Recently viewed
articles articles".
CAx data The CAx data area gives you access to the latest product data for your CAx or CAe
system. You configure your own download package with a few clicks:
• Product images, 2D dimension drawings, 3D models, internal circuit diagrams,
EPLAN macro files
• Manuals, characteristics, operating manuals, certificates
• Product master data
You can find "mySupport" on the Internet. (https://support.industry.siemens.com/My/ww/en)
Application examples
The application examples support you with various tools and examples for solving your
automation tasks. Solutions are shown in interplay with multiple components in the system -
separated from the focus on individual products.
You can find the application examples on the Internet.
(https://support.industry.siemens.com/cs/ww/en/ps/ae)
Web server
20 Function Manual, 11/2023, A5E03484625-AK
Safety and security instructions 2
2.1 Cybersecurity information
Siemens provides products and solutions with industrial cybersecurity functions that support
the secure operation of plants, systems, machines, and networks.
In order to protect plants, systems, machines, and networks against cyber threats, it is
necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial
cybersecurity concept. Siemens’ products and solutions constitute one element of such a
concept.
Customers are responsible for preventing unauthorized access to their plants, systems,
machines and networks. Such systems, machines and components should only be connected
to an enterprise network or the internet if and to the extent such a connection is necessary
and only when appropriate security measures (e.g. firewalls and/or network segmentation)
are in place.
For more information on protective industrial cybersecurity measures for implementation,
please visit (https://www.siemens.com/global/en/products/automation/topic-areas/industrial-
cybersecurity.html).
Siemens' products and solutions undergo continuous development to make them more
secure. Siemens strongly recommends that product updates are applied as soon as they are
available and that the latest product versions are used. Use of product versions that are no
longer supported, and failure to apply the latest updates may increase customers' exposure to
cyber threats.
To stay informed about product updates at all times, subscribe to the Siemens Industrial
Cybersecurity RSS Feed under
(https://new.siemens.com/global/en/products/services/cert.html).
Web server
Function Manual, 11/2023, A5E03484625-AK 21
General information 3
3.1 Properties of the Web server
Security functions
The web server provides the following safety functions:
• Access via the secure transmission protocol "HTTPS" using the CA-signed web server
certificate
• User authorizations you can configure by means of user list
• Activation for specific interfaces
Web server
22 Function Manual, 11/2023, A5E03484625-AK
General information
3.1 Properties of the Web server
Web browser
You need a web browser to access the HTML pages of the CPU.
The web browsers listed below have been tested for communication with the CPU. Other web
browsers may also work, especially newer versions. However, if problems occur with web
browsers not mentioned here that cannot be rectified, use one of the following tested web
browsers:
• Microsoft Edge (Version 116.0)
• Google Chrome (Version 116.0)
• Mozilla Firefox (Version 116.0.3)
• Opera (Version 102.0)
• Mobile Safari and Chrome (iOS 12.5.1, 16.5)
• Android browser (7.x, 8.x and 10.x, 11.x, 12.x)
• Chrome for Android (7.x, 8.x and 10.x, 11.x, 12.x)
• HMI Panels:
– Basic Panel
– Comfort Panel
NOTE
If you are using Internet Explorer, deactivate "Compatibility view" in the settings ("Options"
menu).
NOTE
For access to display devices with low screen resolution, we recommend the use of basic web
pages, see section Basic websites (Page 151).
NOTE
Older versions of the web browsers named above, which previously supported access to the
HTML pages of the CPU, continue to allow this. However, these older versions do not support
the new functions and HTML pages described in this edition.
NOTE
Two reserved communication connections are available to the web server for communication
with the CPU.
Depending on the web browser used, different numbers of connections to the CPU are
established. If more connections are available, more communication connections will be
established.
If no more connections are available, display or functional problems may occur. This is
because the web server will reject all other communication connections apart from the two
that are reserved.
For this reason, the web pages may not load fully.
Web server
Function Manual, 11/2023, A5E03484625-AK 23
General information
3.1 Properties of the Web server
NOTE
If you access the web server of the CPU using a communications processor (CP), ensure that
the cache (temporary Internet files) is activated in your web browser. Choose the
"Automatically" option in the cache settings of your web browser.
If the cache is deactivated or if a setting other than "Automatically" is made in the cache
settings of your web browser, this may result in slow access times and incomplete display.
NOTE
After a firmware update of the CPU, incorrect display of web pages can occur in various web
browsers. This is caused by problems of the new CPU firmware with the cache of the web
browser.
Solution: Press F5 or clear the web browser cache.
NOTE
Web browser behavior can be different if a certificate is not valid yet or is no longer valid.
Siemens has no influence on this behavior. This means we cannot guarantee the reliable
functionality of the web server with invalid certificates.
Web server
24 Function Manual, 11/2023, A5E03484625-AK
General information
3.1 Properties of the Web server
NOTE
Max. characters at data type WSTRING
Note that the data type WSTRING is limited to 254 characters for the display in the web
server. If the 254 characters are exceeded, the web server does not display the superfluous
characters.
Web access to the CPU via PG/PC, HMI devices and mobile end devices
Proceed as follows to access the web server:
1. Use STEP 7 to download a project in which the web server is activated to the CPU.
2. Connect the display device (PG/PC, HMI, mobile terminal device) with the CPU or a
communications module using a PROFINET interface.
If you are working with WLAN, activate the WLAN on the display device and establish a
connection to the access point (e.g. SCALANCE W788-1RR or SCALANCE W784-1), which is
in turn connected to the CPU.
3. Open the web browser on the display device.
4. Enter the IP address of the interface of the CPU which is connected to the client in the
"Address" field of the web browser in the following format: https://a.b.c.d (entry example:
https://192.168.3.141).
The introduction page of the CPU opens. From the intro page you can navigate to more
information.
More information on access using the secure transmission protocol "HTTPS" is available in the
section Configuring the Web server (Page 26).
Web server
Function Manual, 11/2023, A5E03484625-AK 25
General information
3.2 Configuring the Web server
More information
Using a smartphone, you can access the web server of the CPU either via WLAN or access to
the CPU via the SIMATIC S7 app (using web server functionality). You can find additional
information in the FAQ entry ID 103473392 on the Service&Support
(https://support.industry.siemens.com/cs/ww/en/view/103473392) Internet page.
Note: The web server must also be activated for access to the CPU via the SIMATIC S7 app.
The SIMATIC S7 app offers you additional functions. You can find a detailed application
example with further documentation and example projects on the Service&Support
(https://support.industry.siemens.com/cs/ww/en/view/84133612) Internet page.
Figure 3-1 Security note upon activation of the Web server in STEP 7
NOTE
When projects from deliveries are applied in which the Web server was already activated
and configured on the module, this security note is not shown.
NOTE
Activating Web server for R/H-CPUs
For R/H-CPUs you can only activate the Web server for both R/H-CPUs and the identical
settings. In addition to the Web server properties, this also applies to the "Overview of the
interfaces", for the certificates and the user management.
You can use the IP addresses of both CPUs to use the Web server.
Web server
26 Function Manual, 11/2023, A5E03484625-AK
General information
3.2 Configuring the Web server
Depending on the CPU used, you can make your own settings or the settings are fixed.
NOTE
When using secure communication (e.g. HTTPS), make sure that the corresponding
modules have the current time of day and the current date. Otherwise the modules
cannot check the validity period or evaluate the certificates used as invalid. Therefore, a
secure connection cannot be established.
Web server
Function Manual, 11/2023, A5E03484625-AK 27
General information
3.2 Configuring the Web server
• A valid Web server certificate offered by the CPU is installed in the web browser.
NOTICE
Safety-related functions only possible with CA-signed Web server certificate
The safety-related functions backup and restoring the CPU configuration, see section
Online backup (Page 97), are only possible with a CA-signed Web server certificate.
A valid CA-signed Web server certificate in the CPU is also required:
– User management with password-protected users
– Saving and downloading diagnostics information in csv files
To use the full functionality of the Web server, we therefore recommend that you use the
Certificate Manager to create a CA-signed server certificate in the global security settings
and assign it to the CPU.
NOTE
To protect against manipulation from the outside, download the certificate only in an
environment that is guaranteed not to be compromised. Installation of the CA certificate has
to be carried out once for each display device you wish to use.
Web server
28 Function Manual, 11/2023, A5E03484625-AK
General information
3.2 Configuring the Web server
NOTE
The default activation interval is 10 seconds.
Larger data volumes or multiple HTTP/HTTPS-connections increase the update time.
Web server
Function Manual, 11/2023, A5E03484625-AK 29
General information
3.3 Certificate
User-defined pages
In the "User-defined pages" area, you can download your own web pages to the CPU and
make your own web applications available via the web browser.
You can find more information in section User pages (Page 124).
Figure 3-3 Enabling access to the Web server via the interfaces
3.3 Certificate
Web server
30 Function Manual, 11/2023, A5E03484625-AK
General information
3.3 Certificate
NOTE
If you update the firmware of a SIMATIC S7 1500 CPU or ET 200SP CPU with a firmware
version < V2.0 to a firmware version ≥ V2.0, a valid Web server certificate is automatically
generated and used. The same applies to the replacement parts scenario in which a newer
CPU replaces a CPU with firmware version < V2.0.
If you update or replace an already configured CPU, a valid Web server certificate is
automatically generated and used for CPUs with a firmware version ≤ V1.8.
NOTICE
Utilizing the full functionality of the Web server
A valid CA-signed Web server certificate in the CPU is a requirement for the following
functions:
• User management with password-protected users
• Saving and downloading diagnostic information in csv files
• Backup and restore of security-related functions such as the configuration of the CPU
To use the full functionality of the Web server, we therefore recommend you activate the
global security settings of the certificate manager, create a CA-signed Web server certificate
and assign it to the CPU.
Web server
Function Manual, 11/2023, A5E03484625-AK 31
General information
3.3 Certificate
4. Enter the parameters for the new certificate or confirm the default settings.
– Select "Web server" in the "Usage" box.
– Enter the IP address(es) of the interface(s) or the domain name of the configured CPU
in the "Subject Alternative Name" field.
5. Click "OK" to confirm.
6. Compile and load the configuration into the CPU.
The device certificate of the Web server is a component of the configuration.
NOTE
For managing certificates with the global security settings, you require the "Configure
security" configuration permission.
3. Log in as a user in the project tree in the "Security settings" section. The "Administrator"
role is the default for the first logon for a new project.
4. In the Inspector window Properties of the CPU, "General" tab, navigate to the "Web server
> Security" area.
5. Click the "Add" button in the drop-down list to select a certificate.
The "Create certificate" dialog opens.
6. In the follow-up dialog, select the "Signed by certificate authority" check box and select
the certificate authority from the drop-down list.
7. Enter the parameters for the new certificate or confirm the default settings.
– Select "Web server" in the "Usage" box.
– Enter the IP address(es) of the interface(s) or the domain name of the configured CPU
in the "Subject Alternative Name" field.
8. Click "OK" to confirm.
9. Compile and load the configuration in the CPU.
The device certificate of the Web server and the CA certificate are components of the
configuration.
Web server
32 Function Manual, 11/2023, A5E03484625-AK
General information
3.3 Certificate
NOTICE
Addressing the Web server of the CPU via domain names
If you enter the IP address(es) of the interface(s) of the configured CPU in the "Subject
Alternative Name" field, the generated certificate may not be accepted by all Internet
browsers. In addition, you must generate and load a new Web server certificate (end entity
certificate) with each change of the IP address of an Ethernet interface of the CPU, since the
identity of the CPU changes with the IP address.
You can avoid this problem by addressing the Web server of the CPU using domain names
instead of IP address(es), e.g. "myconveyer-cpu.room13.myfactory.com". For this purpose,
you have to manage the domain names of your CPU via a DNS server. Addressing via domain
names is recommended especially for a configuration with reception of the IP address from a
DHCP server, as in this case the assigned IP address is not known beforehand.
More information
For detailed information on local self-signed and global CA-signed certificates, on the "Public
Key Infrastructure" (PKI) and on certificate management, refer to the Communications Func
tion Manual (https://support.industry.siemens.com/cs/ww/en/view/59192925) and to the
STEP 7 online help, keyword "Secure Communication".
The application example "The use of certificates with the TIA Portal
(https://support.industry.siemens.com/cs/de/en/view/109769068)" includes detailed
instructions on how to create a secure connection to the Web server of a SIMATIC S7-1500
CPU.
Web server
Function Manual, 11/2023, A5E03484625-AK 33
General information
3.3 Certificate
If you want to submit certificates via GDS at runtime, click the "Use certificates provided by
the certificate management during runtime" option.
By selecting the "Enable system diagnostics event for certificate expiration" button, you
specify that you want to be notified when a certificate expires. In the input field "Show event
at remaining certificate validity period of:" enter a percent value. At the time this value is
reached, the CPU triggers a system alarm with a maintenance request.
Example:
The certificate transferred via GDS on 01/06/2022 has a validity from 01/06/2022 to
30/06/2022 (30 days). You have input a percent value of 10 for the diagnostics event. On
27/06/2022, after 90% of the validity period has expired, the system diagnostics alarm reports
that the transmitted certificate will expire on 30/06/2022.
Regardless of the configured percentage value, a message appears in any case when the
validity period of a certificate expires.
NOTE
Time settings in the CPU
In order for the CPU to detect the expiration of a certificate, you must set the system time to
Coordinated Universal Time (UTC). An incorrect system time can lead to incorrect messages
regarding the expiration of certificates.
Web server
34 Function Manual, 11/2023, A5E03484625-AK
General information
3.3 Certificate
In the lower area of the "Certificate manager" category in the table, you can find a list of all
CPU applications with certificates you may transfer to the CPU at runtime. In the list, the CPU
applications are assigned an ID. Under the "Folder for certificate repository at runtime"
column, you can find the changeable name of the certificate group.
Web server
Function Manual, 11/2023, A5E03484625-AK 35
General information
3.3 Certificate
Web server
36 Function Manual, 11/2023, A5E03484625-AK
General information
3.4 Language settings
Introduction
The Web server provides the user interface in the following languages:
• German (Germany)
• English (USA)
• French (France)
• Italian (Italy)
• Spanish (traditional sort)
• Japanese
• Chinese (Simplified)
• Korean
• Russian
• Turkish
• Portuguese (Brazil)
NOTE
SIMATIC HMI devices with the Windows CE operating system do not support East Asian
languages.
NOTE
The project languages of the STEP 7 project that you want to assign must be activated and
the corresponding texts (translations) must be available in the project. You can find a list of
available project languages in the project tree under "Languages & resources".
Web server
Function Manual, 11/2023, A5E03484625-AK 37
General information
3.4 Language settings
You can also assign user interface languages the same project language, for example:
• ① Project language German for user interface language German, English (USA) for
English, French for French.
• ② Project language English (USA) for all other available user interface languages of the
Web server.
In total, you can assign up to three different project languages of the STEP 7 project to the
user interface languages of the Web server.
Web server
38 Function Manual, 11/2023, A5E03484625-AK
General information
3.5 User management
Reference
You can find more information on how to set the project language in STEP 7 in the STEP 7
online help, keyword: "Selecting project languages".
Static user management for CPUs with configured firmware version ≤ V3.0
Figure 3-7 User management in TIA Portal for CPUs with configured firmware version ≤ V3.0
In the TIA Portal you can manage the user list in the "Web server > User management"
area.
The user list provides the following options:
• Create users
• Specify access permissions
• Assign passwords
Users only have access to the options that are permanently linked to the access rights.
You can assign different user rights depending on the CPU and firmware used.
Web server
Function Manual, 11/2023, A5E03484625-AK 39
General information
3.5 User management
The available user rights can be available for selection in TIA Portal as follows:
Figure 3-8 Assignment of user rights in TIA Portal for CPUs with configured firmware version ≤ V3.0
Local user management for CPUs with configured firmware version ≥ V3.1
As of TIA Portal version V19 and CPU firmware version V3.1, S7-1500 CPUs feature improved
management of users, roles, and CPU function rights (User Management & Access Control,
UMAC). Software Controller as of version V30.1 also have this function. You manage all
project users along with their rights (for example, access rights) for all CPUs in the project in
the editor for users and roles of the project in the TIA Portal:
• Navigate to the "Security Settings > Users and roles" area in the project tree to manage
users with their rights, for example, to control access rights.
The TIA Portal saves the assignment of the function rights of a CPU to user-defined roles and
the assignment of these roles to users for each CPU. There are no system-defined roles with
predefined function rights for CPUs. After loading the configuration, the user management
becomes effective in the respective CPUs. After loading, every CPU "knows" who may access
which service and execute specific functions.
Web server
40 Function Manual, 11/2023, A5E03484625-AK
General information
3.5 User management
Web server
Function Manual, 11/2023, A5E03484625-AK 41
General information
3.5 User management
Procedure:
In the following example, you assign the "admin" role to the user "User_1" with all rights for
the Web server:
1. Create a new local user in the "User" tab, in the example "User_1", and assign a password.
2. Define one or more roles in the "Roles" tab, the role "admin" in the example.
Web server
42 Function Manual, 11/2023, A5E03484625-AK
General information
3.5 User management
3. Assign function rights for the Web server to the "admin" role. To do this, switch to the
"Runtime rights" tab and select all function rights for the Web server for the example.
Web server
Function Manual, 11/2023, A5E03484625-AK 43
General information
3.5 User management
4. Assign one or more roles to the user "User_1" in the tab "Assigned roles". In the example,
you assign the "admin" role to the user "User_1". The roles and rights assigned to a user
can be found in the corresponding tabs.
Web server
44 Function Manual, 11/2023, A5E03484625-AK
General information
3.5 User management
WARNING
For an F-CPU, do not assign the access authorization "Perform changes as F-Admin" to the
user "Everybody"/"Anonymous".
Make sure that you observe the warnings relating to this in the section "Restoring a backup
of the safety program to an S7-300/1500 F-CPU" in the manual SIMATIC Safety - Configuring
and Programming (https://support.automation.siemens.com/WW/view/en/54110126).
Passwords should always be more than 8 characters in length and contain uppercase and
lowercase characters as well as special characters and numbers (?!+%$1234...). Computer
keyboard character strings and words from the dictionary are unsuitable. Change the
password regularly.
You can read the password policies of the CPU as of firmware version V3.1 with the
Api.GetPasswordPolicy method. In the TIA Portal you can read the policies and change these
in the project tree via "Security settings" > "Settings" > "Password policies". You can find more
information in the online help for the TIA Portal.
NOTE
When assigning rights, note that read and write access to tags of the "Watch tables (Page 95)"
and "Tag status (Page 93)" web pages is retained, even if you have deactivated the attribute
"Accessible from HMI/OPC UA/Web API" in the PLC tag table when configuring the data block
in STEP 7.
Web server
Function Manual, 11/2023, A5E03484625-AK 45
General information
3.6 Updating and saving information
NOTE
If the load on the CPU is very high during operation, for example, due to a large number of
PROFINET interrupts or extensive communication jobs, the updating of web pages may be
significantly delayed for the duration of this high CPU load.
Web server
46 Function Manual, 11/2023, A5E03484625-AK
Web pages 4
4.1 Start page with general CPU information
NOTE
Web pages for R/H-CPUs
Note that the web pages are not available for R/H-CPUs. If you enter the IP address in the
address bar of the browser, the error message "404 NOT FOUND" appears.
The examples in the next section provide information about the different web pages.
Intro
The figure below shows the first page (Intro) called by the Web server.
Figure 4-1 Introduction page of the Web server of the CPU 1516-3 PN/DP
Web server
Function Manual, 11/2023, A5E03484625-AK 47
Web pages
4.1 Start page with general CPU information
NOTE
Select the "Skip Intro" check box in order to skip the intro. The Web server will then take you
directly to its start page in future. This setting is saved in the user profile of the current PC
user.
You can undo the setting "Skip Intro" by clicking the "Intro" link in the left-hand navigation
bar of a web page.
Web server
48 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.1 Start page with general CPU information
The displayed PLC local time comes from the time zone set in the CPU properties without
consideration of the daylight saving / standard time setting.
Web server
Function Manual, 11/2023, A5E03484625-AK 49
Web pages
4.1 Start page with general CPU information
Start page
The start page before login offers information as shown in the figure below. The image of the
CPU with LEDs shows its current status at the time of the data request.
General:
Start page
Project name: Project1
TIA Portal: V17
Station name: CPU 1516
Module name: SIMATIC S7 CPU 1516
Module type: CPU 1516-3 PN/DP
Introduction
Status:
Operating Mode: RUN
Status: OK
Mode selector: RUN
Web server
50 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.1 Start page with general CPU information
Log in
To use the full functionality of the web pages, you must be logged in. Log in with a user
name and password specified in the Web configuration in STEP 7. You now have
corresponding permissions to access the web pages released for this user. If you have not
configured a user, read-only access is granted to intro and start pages by default.
NOTE
After carrying out your required actions, log out explicitly from the Web server by clicking
"Logout" in order to minimize the risk of unauthorized external access.
NOTE
Session timeout
The timeout for each started session is 30 minutes. After each update/automatic update, the
session is automatically extended by another 30 minutes.
Web server
Function Manual, 11/2023, A5E03484625-AK 51
Web pages
4.1 Start page with general CPU information
① "General"
"General" contains information about the CPU whose Web server you are currently connected
to, as well as the project name and the version of the TIA Portal with which the CPU was
configured. The displayed TIA Portal version is at least required to load or edit the entire
project.
② "Status"
"Status" contains information about the CPU status at the time of the query.
Web server
52 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.1 Start page with general CPU information
④ "Fail-safe"
"Fail-safe" contains additional information on the F-CPU. Further information about the
specification is available in the Programming and Operating Manual SIMATIC Safety - Config
uring and Programming
(https://support.industry.siemens.com/cs/de/de/view/54110126/en?dl=en).
Reference
You can find additional information in the section Configuring the Web server (Page 26).
Web server
Function Manual, 11/2023, A5E03484625-AK 53
Web pages
4.2 Diagnostics
4.2 Diagnostics
Overview
The "Diagnostics" web page provides more information about the tabs:
• Identification
• Program protection
• Memory
• Runtime information
• Fail-safe (with an F CPU)
"Identification" tab
The CPU characteristics are available in the "Identification" tab.
Web server
54 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.2 Diagnostics
"Identification"
The "Identification" info box contains the plant and location designation and the serial
number. Plant and location designations can be configured in STEP 7 in the properties dialog
of the CPU in the "General" tab.
"Order number"
The "Order number" info box contains the order number for the hardware.
"Version"
You can find the information on hardware version, firmware version on the CPU and
bootloader version in the "Version" info box.
"Drive Controller Info"
If you are using a SIMATIC drive controller, you will find information about the hardware
update version of the drive controller, the firmware version of SINAMICS Integrated, and a
link to the readable information of SINAMICS Integrated.
You can find more information in the SIMATIC Drive Controller
(https://support.industry.siemens.com/cs/ww/en/view/109766665) System Manual.
"Motion control package information"
Display of the name and version of the Motion Control technology package used (Technology
Package Standard Motion Control or Technology Package Motion Control KinPlus).
For more information, refer to the SIMATIC S7-1500 S7-1500T Kinematics Functions
(https://support.industry.siemens.com/cs/ww/en/view/109781850) manual.
Diagnostics
Know-How protection:
Know-How protection: not present
Binding:
Memory card
serial number: no binding
CPU serial number: no binding
Web server
Function Manual, 11/2023, A5E03484625-AK 55
Web pages
4.2 Diagnostics
"①Know-how protection"
Information on whether the PLC program contains at least one block with know-how
protection or not can be found in the info field "Know-how protection".
②"Binding"
In the info field "Binding" you can find information on whether copy protection has been
activated by binding at least one program block of the PLC program to the serial number of
the CPU or memory card.
• "Binding"
• "No binding"
• "Binding mismatch": At least one block is bound to a different serial number (load process
is rejected)
"Memory" tab
The "Memory" tab contains current values on the memory currently in use.
Web server
56 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.2 Diagnostics
Program-/Communication load
With the "Value refresh" function, you update the data displayed in the bar charts:
• At intervals of 1 second
• Automatic (as configured in STEP 7)
With the "Measurement" function, you can decide which measurement the bar charts display.
You can choose between:
• The current measurement
• The measurement of the longest cycle time
Web server
Function Manual, 11/2023, A5E03484625-AK 57
Web pages
4.2 Diagnostics
The legend of the program-/communication load shows information on the following values,
highlighted in color:
• "Program load cyclic program OBs"
required computing time in percent within a cycle for cyclic program OBs
• "Program load high-priority OBs"
Required calculation time in percent within a cycle for higher-priority OBs (priority ≥ 15)
• "Current communications load"
Required calculation time in percent for current communications tasks within a cycle
• "Maximum permissible communication load"
The configured maximum communication load as a percentage
• "No-load operation"
There is no program-/communication load
NOTE
When you have configured a minimum cycle time, it can happen that no-load operation
displays a high percentage value, although the value of the cycle time is also high.
The reason for this is that the loads are recorded as mathematical average of the last
second, but the cycle time relates to the last cycle.
Web server
58 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.2 Diagnostics
Example 1:
Figure 4-13 Cycle time < 70% of the maximum cycle time
Example 1 shows that the CPU can process the user program within the maximum cycle time
of 150 ms when the maximum communication load of 38% is reached. The predicted cycle
time is < 70% of the configured maximum cycle time.
Example 2:
Web server
Function Manual, 11/2023, A5E03484625-AK 59
Web pages
4.2 Diagnostics
Example 3:
NOTE
Setting the communication load
The controller predicts the effects of the changed communication load on the cycle time. You
configure the maximum communication load in STEP 7.
Web server
60 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.2 Diagnostics
NOTE
For non-measurable fluctuations in the user program, e.g. for future changes in the user
program, plan a sufficiently low value for the maximum communication load.
NOTE
Due to the different acquisition bases of cycle time and load, a settled system state is
required to display reliable measured values.
You can find more information about the influence of the communication load on the cycle
time in the Cycle and Response Times Function Manual
(https://support.industry.siemens.com/cs/us/en/view/59193558).
Trend for program/communication load
If your web browser supports the display of SVG (Scalable Vector Graphics), the display in the
"Runtime information" tab is expanded to show the trend for program/communication load.
With the line charts in the "Trend for program/communication load" area, you can track the
progression of the following values:
• "Program load of the cyclic program OBs"
• "Program load high-priority OBs"
• "Current communications load"
With the "Number of recorded measuring points" option, you can choose between the last 20
to 1 000 measured values for the display of the measured values.
For the trend on the x-axis, you can choose between "Time" (CPU time) and "Samples" by
clicking on the desired unit.
NOTE
If you have selected the "Time" unit on the x-axis, all measured values that are more than
24 hours old are deleted automatically.
Web server
Function Manual, 11/2023, A5E03484625-AK 61
Web pages
4.2 Diagnostics
Web server
62 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.3 Diagnostics buffer
Requirements
The web server is activated, languages are set, the text libraries are loaded and the project
has been compiled and downloaded with STEP 7.
Diagnostics buffer
The content of the diagnostic buffer is displayed by the browser on the web page
"Diagnostics buffer".
Diagnostic Buffer
Diagnostic buffer entries 1-50 Off
Web server
Function Manual, 11/2023, A5E03484625-AK 63
Web pages
4.4 Motion Control diagnostics
② "Event"
The "Event" info box contains the diagnostics interrupts with date and time.
Note that the diagnostic events are displayed in the project language of the STEP 7 project
that is assigned to the current web server interface language. You can find out how to assign
project languages to interface languages in section Language settings (Page 37).
③ "Details"
This field outputs detailed information about a selected event. Select the corresponding event
from the ② "Event" info field.
Overview
On the "Motion Control Diagnostics" web page, you will find the status, error, and warning
bits as well as the latest values for the configured technology objects (TO).
The Web server supports the following technology objects:
• Speed-controlled axis (TO_SpeedAxis)
• Positioning axis (TO_PositioningAxis)
• Synchronous axis (TO_SynchronousAxis)
• External encoder (TO_ExternalEncoder)
• Measuring input (TO_MeasuringInput)
• Output cam (TO_OutputCam)
• Cam track (TO_CamTrack)
• Cam disk (TO_Cam, TO_Cam_10k) (S7-1500T)
• Leading axis proxy (TO_LeadingAxisProxy) (S7-1500T)
• Kinematics (TO_Kinematics) (S7-1500T)
• Interpreter (TO_Interpreter) (S7-1500T)
The web page is subdivided into the tabs:
• Diagnostics
• Service overview
Web server
64 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.4 Motion Control diagnostics
"Diagnostics" tab
In the "Diagnostics" view you will see:
• ① A list of the configured technology objects
• ② The status and error bits of a selected technology object
• ③ Specific diagnostic information for the technology objects
Web server
Function Manual, 11/2023, A5E03484625-AK 65
Web pages
4.4 Motion Control diagnostics
Click on a technology object in the list to display the current status and error bits ② as well as
specific diagnostic information ③ for this technology object.
Web server
66 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.4 Motion Control diagnostics
1. To sort the list of technology objects, click on the column header "TO Name" or "TO Type".
2. To observe a technology object in the signal table, select the check box in front of the
technology object.
A column is only displayed for the selected technology objects in the signal table. Signals
that do not exist for the selected technology objects are hidden.
Web server
Function Manual, 11/2023, A5E03484625-AK 67
Web pages
4.4 Motion Control diagnostics
② Signal table
In this area, you select which signals of the selected technology objects you want to observe.
The signals are grouped.
1. To expand or collapse a scaling group, click the arrow in front of the scaling group.
2. To only observe selected scaling groups or signals, select the check box in front of the
scaling group or signal.
3. Click the icon.
Only the selected signal groups or signals are displayed.
4. Click the icon again.
All signal groups and signals are displayed.
Web server
68 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.5 Module information
More information
You can find explanations for the diagnostics functions of the individual technology objects in
the STEP 7 online help or the S7-1500/1500T Motion Control function manuals on the Inter
net (https://support.industry.siemens.com/cs/ww/en/view/109751049).
Module information
The status of a device is indicated by means of symbols and comments on the "Module
information" web page.
Module information
Off
CPU1516
Status Device number Name Gateway Comment
1 PROFIBUS(1): DP-Mastersystem (1) Details
2 Ethernet(1): PROFINET-IO-System (100) Details
3 CPU 1516 Details
Status Identification
Web server
Function Manual, 11/2023, A5E03484625-AK 69
Web pages
4.5 Module information
! red A module in a lower module level does not have the status "Component OK"
Module information
CPU1516 - Ethernet(1): PROFINET-IO-System(100) Off
Status Identification Statistics
Total statistics
Sent data packages:
Sent without errors: 6159
Statistics Port 1
Sent data packages:
① "Module information"
Depending on the selected level, the table contains information on the rack, the DP master
system, the PROFINET IO master system, the stations, the individual modules or the modules
or submodules of the station.
Web server
70 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.5 Module information
③ "Topology"
The two web pages, "Topology" and "Module information", are linked. A click on "Topology" of
the selected module automatically takes you to this module in the graphic view of the set
topology on the "Topology" web page. The module is displayed in the visible area of the
"Topology" web page. The device header of the selected module flashes for a few seconds.
④ "IP address"
If a link is available, you can use it to access the Web server of the configured device you
selected.
⑤ "Details"
More information about the selected module is provided in the "Status" and "Identification"
tabs via the "Details" link.
⑥ "Status" tab
The tab contains information about the status of the selected module when a fault or alarm
exists.
⑦ "Identification" tab
The tab contains data on the identification of the selected module.
NOTE
This tab displays only the data configured offline of the module.
⑧ "Statistics" tab
The tab is only displayed for PROFINET IO devices and contains the following information on
the communication statistics of the selected IO device:
• "Total statistics - Sent data packages"
You can assess the data transmission on the transmit line based on the key data in this
info box.
• "Total statistics - Received data packages"
You can assess the data transmission on the receive line based on the key data in this info
box.
• "Statistics port x - Sent data packages"
You can assess the data transmission on the transmit line for each port based on the key
data in this info box.
Web server
Function Manual, 11/2023, A5E03484625-AK 71
Web pages
4.5 Module information
Status Identification Statistics
Total statistics
Sent data packages:
Statistics Port 1
Sent data packages:
Sent without errors: 869
Reference
You can find more information in the "Statistics" tab in the section Communication (Page 78).
Reference
You can find more information about the F-parameters in the Programming and Operating
Manual SIMATIC Safety - Configuring and Programming
(https://support.automation.siemens.com/WW/view/en/54110126).
Web server
72 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.5 Module information
Module information
CPU1516 - Ethernet(1): PROFINET-IOSystem (100) - IM155-5PNST Off
Slot Status Device number Name Order number I address Q address Comment
0 1 IM155-5PNST Details 6ES7155-6AA00-0BN0
1 2 PS 1505 25Wx24 VDC Details 6ES7505-5KA00-0AB0 ...Modul PS (3)
2 3 DI 16x24VDC HF Details 6ES7521-1BH00-0AB0 2 ...Modul DI (3)
3 4 DQ 16x24VDC/0.5A ST Details 6ES7522-1BH00-0AB0 5 ...Modul DQ (3)
Status Identification
NOTE
If you are using the function Configuration control (option handling) in the central
configuration of your plant, the information text in the headings area of the web page
informs you that the status of the I/O modules may be displayed inconsistently. No
corresponding text is displayed for the distributed I/O.
Module information
CPU1516 - Ethernet(1): PROFINET-...-IM155-5PNST - IM155-5PNST Off
Slot Status Device number Name Order number I address Q address Comment
X1 1 MyIM155-5PNST(3) Details 6ES7155-5AA00-0AB0
X1 P1 2 MyPort1 (3) Details
X1 P2 3 MyPort2 (3) Details
Status Identification
Reference
You can find more information on the "Module information" in the STEP 7 online help,
keyword: "Module information".
Web server
Function Manual, 11/2023, A5E03484625-AK 73
Web pages
4.6 Firmware update
Introduction
You can update the firmware as a user with the corresponding access rights on the "Module
information" web page at the module level. You can find information on user management in
section Configuring the Web server (Page 26) under "Amending user management".
With the help of an update file, you can update the firmware of the CPU, the display of the
CPU, or individual centralized and distributed modules. Note that all modules you want to
update must be compatible with the TIA Portal as of V12.0.
NOTE
A firmware update is not possible if access is via a mobile terminal device with the "iOS"
operating system.
Web server
74 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.6 Firmware update
Procedure
The following steps are required to perform a firmware update:
• Click on "Browse" in the Firmware Loader area.
• Select the file you would like to use for the firmware update. You can find the available
firmware updates on the Service&Support page on the Internet
(https://support.automation.siemens.com).
Slot Status Device number Name Order number I address Q address Comment
0 1 IM155-5PNST Details 6ES7155-6AA00-0BN0
1 2 PS 1505 25Wx24 VDC Details 6ES7505-5KA00-0AB0 4
2 3 DI 16x24VDC HF Details 6ES7521-1BH00-0AB0 2
3 4 DQ 16x24VDC/0.5A ST Details 6ES7522-1BH00-0AB0 1
Online data:
Order number: 6ES7521-1BH00-0AB0
Firmware: R6.0.0
Name: DI 16x24VDC HF
Rack: ---
Slot: 2
Firmware loader:
Firmware file: D:\Documents\users\a Search
Firmware Version: V1.0
Suitable for modules: 6ES7521-1BH00-0AB0
Status: Ready for update
Run update
• If the status is "Ready for update", click "Run update". If the CPU is in RUN mode during the
update, the following alarm is output:
Web server
Function Manual, 11/2023, A5E03484625-AK 75
Web pages
4.7 Alarms
• A alarm informs you about the order number and version ID of the updated firmware once
the update is complete.
The CPU is automatically placed in RUN mode when the mode selector of the CPU is in
RUN and when you acknowledge the alarm with "OK". This may take a few minutes; there
is no progress indicator.
If you click "Cancel", the CPU remains in STOP mode and you can run additional updates.
Reference
For more information on the topic of firmware update, refer to the STEP 7 online help and the
following FAQ on the Internet
(https://support.industry.siemens.com/cs/ww/en/view/67190848).
4.7 Alarms
Requirements
The alarm texts were configured in the user-specific languages. You can find information
about the configuration of alarm texts in STEP 7.
Alarms
To receive compact information on fault analysis, we recommend that you always first read
out the content of the alarm buffer. This is the most effective method to get an overview of
the pending faults.
The browser displays the content of the alarm buffer on the "Alarms" web page.
Web server
76 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.7 Alarms
① "Alarms"
Alarms of the CPU are displayed in descending chronological order with date and time in info
box ①.
The alarm text parameter is an entry which contains the alarm texts configured for the
corresponding fault definitions.
Note that the message texts are displayed in the project language of the STEP 7 project that is
assigned to the current Web server interface language. You can find out how to assign project
languages to interface languages in section Language settings (Page 37).
Sorting
You also have the option to display the individual parameters of the currently displayed web
page (max. 50 entries) sorted in ascending or descending order. For this purpose, click on
one of the parameters in the column header:
• Alarm number
• Date
• Time (of the CPU)
• Alarm text
• Status
• Acknowledgment
The alarms are returned in chronological order when you click the "Date" entry. Incoming and
outgoing events are output at the Status parameter.
If you have the appropriate user rights (see section Configuring the Web server (Page 26)),
for alarms which can be acknowledged, a button is available to you in the "Acknowledgment"
column with which you can acknowledge the alarm.
Saving alarms
You can save alarms to a csv file for further processing in a spreadsheet program or database
program.
Save the data by clicking the icon.
A dialog opens in which you can specify the file name and target directory.
Web server
Function Manual, 11/2023, A5E03484625-AK 77
Web pages
4.8 Communication
4.8 Communication
Overview
The "Communication" web page provides detailed information about the following tabs:
• Parameters
• Statistics
• Resources
• Connections
Web server
78 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.8 Communication
① "Parameter" tab
A summary of the information on the PROFINET and Ethernet interfaces of the selected CPU is
available in the "Parameter" tab.
Web server
Function Manual, 11/2023, A5E03484625-AK 79
Web pages
4.8 Communication
④ "Network connection"
Under "Network connection", you will find information for identification of the integrated
PROFINET and Ethernet interfaces of the corresponding CPU. The MAC address is located on
the CPU above the respective PROFINET or Ethernet interface.
⑤ "IP parameter"
This parameter includes information on the configured IP address and number of the subnet
in which the corresponding CPU is located. If a client ID for DHCP was configured for the CPU,
it is displayed here.
⑥ "Physical properties"
The following information on the interface hardware is available in the "Physical properties"
field:
• Port number
• Link status
• Settings
• Mode
• Connection medium
Web server
80 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.8 Communication
① "Statistics" tab
Information on the data transmission can be found on the "Statistics" tab.
Communication
Off
Parameter Statistics Ressources Connections
Total statistics
Sent data packages:
Sent without errors: 193241885 Bytes
Statistics X1 P1
Sent data packages:
Sent without errors: 193241309 Bytes
Collision during sending attempt: 0
Canceled due to other errors: 0
Received data packages:
Statistics X1 P2
Sent data packages:
Sent without errors: 0 Bytes
Statistics X2 P2
Sent data packages:
Sent without errors: 576 Bytes
Collision during sending attempt: 0
Web server
Function Manual, 11/2023, A5E03484625-AK 81
Web pages
4.8 Communication
Communication
Off
Parameter Statistics Resources Connections
Number of connections:
Maximum connections: 256
Connections not assigned: 253
② Number of connections
Under "Number of connections", you will find information on the maximum number of
connections and the number of connections not assigned.
Web server
82 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.8 Communication
③ Connections
The item "Connections" provides information on the number of connections reserved or used
for ES, HMI, S7, OpenUser, web communication and other communication functions.
① "Connections" tab
The "Connections" tab contains information on the status of the communication connections.
Communication
Off
Parameter Statistics Resources Connections
Status Local ID (Hex) Slot of Remote address type Remote address Type Type
Connection is established 0 --- IPv4 192.168.1.241 Adhoc WEB
Details:
Address details
Local address: 192.168.1.69
Local port: 443
Diagnostics
Error cause:
Statistics
Current connection establishment attempts: 0
Successful connection establishment attempts: 1
② Status
Under "Status", you will find an overview of the communication connections being
established and the already established communication connections.
For each of these connections, the table contains information about the connection status,
the local ID, the slot of the gateway, the remote address (IP address), the corresponding
remote address type, and the connection types.
③ Details
Under "Details", you will find detailed information about the selected connection.
Reference
For an explanation of the error message displayed when a connection is interrupted or an
attempt to establish a connection fails, refer to the STEP 7 online help.
Web server
Function Manual, 11/2023, A5E03484625-AK 83
Web pages
4.9 Topology
4.9 Topology
4.9.1 Introduction
Set topology
The set topology is displayed if you have topologically interconnected the connections in the
configuration with STEP 7.
This view identifies the topological assignment of PROFINET devices that have failed, the
differences between the set and actual topology, and interchanged ports.
NOTE
The configured set topology is always displayed by default in the following scenarios:
• When the "Topology" web page is called via the navigation bar
• When you change from the overview of PROFINET IO devices on the "Module information"
web page to the "Topology" web page by means of the "Topology" link.
If a setpoint topology was not configured, the actual topology is displayed.
Actual topology
Displays the current topological structure of the "configured" PROFINET devices of a
PROFINET IO system and the directly adjacent, non-configured PROFINET devices (display of
the neighbor relationships, provided these can be determined; but the status of these
adjacent PROFINET devices is not displayed).
Web server
84 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.9 Topology
Requirements
For error-free operation of the topology, the following conditions must be met:
• You have made the Language settings (Page 37).
• In the Topology Editor of STEP 7, you configured the topological interconnection of ports
(requirement for display of the set topology and the corresponding topological target
connections).
• The project has been compiled in STEP 7.
• The project is completely loaded.
Graphic view Table view Status overview Graphic view Table view Status overview
P1 P4 P1 P1 P2 P1 P4 P2 P1 P2
P2
IM155...
IM155-5PN...
IM155-5PN...
P3 P1
P2
P2 P2
P1
IM155-6PN...
IM155-6PN...
IM155...
ie-asi...
IE-ASI...
P1 P2
P2
P1 P2
IM155...
IM155-5PN...
IM155-5PN...
P3 P1
P2
IM155-6PNST-2
IM155... IM155-6PNST-2
P1
P2
IM155-5PN...
IM155-6PN...
IM155-6PN... IM155-5PN...
ie-asi...
IE-ASI...
P2 P1 P2 P1 P2
Web server
Function Manual, 11/2023, A5E03484625-AK 85
Web pages
4.9 Topology
③ Deactivated devices
All deactivated, configured PROFINET devices are displayed in light gray.
④ Interchanged ports
Interchanged ports are highlighted in red in the set topology view. The actual topology view
indicates the actually connected ports, while the set topology view displays the configured
target connections.
Web server
86 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.9 Topology
NOTE
Displaying faulty neighbor relationships
If a device does not have the matching firmware, the relationships cannot be displayed
correctly. This means a firmware update of the respective device is required in case a faulty
neighbor relationship is displayed.
Web server
Function Manual, 11/2023, A5E03484625-AK 87
Web pages
4.9 Topology
Reference
Additional examples for graphical topology view are available in the section Examples for
graphical topology views (Page 90).
Topology
Off
IM155-5PN IM 155-5PN ST
port-001 SCALANCE-X-204IRT port-004
port-002 cpux6-7-1xet200mp port-002
SCALANCE-X-204IRT SCALANCE-X-204IRT
port-001 CPU1516-3PN/DP port-001
port-002
port-003
port-004 IM155-5PN port-001
SCALANCE-X-208 SCALANCE-X-208
cpux6-7-1xet200mp
port-002 IM155-5PN port-002
Figure 4-38 Topology - tabular view
Table 4-4 Meaning of the symbols relating to the status of the PROFINET devices
Symbol Meaning
Configured and accessible PROFINET devices
Devices for which neighbor relations cannot be determined, or for which the neighbor rela
! tionship could not be read out completely, or only with errors
Web server
88 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.9 Topology
② Meaning of the symbols relating to the module status of the PROFINET devices
Table 4-5 Meaning of the symbols relating to the module status of the PROFINET devices
Symbol Color Meaning
green Component is OK.
! - A module in a lower module level does not have the status "Component OK".
Reference
For additional information on the "Report System Error" function, refer to the STEP 7 online
help, keyword: "System diagnostics".
Web server
Function Manual, 11/2023, A5E03484625-AK 89
Web pages
4.9 Topology
Topology
Off
"Set topology" is OK
Here you see the connections as they are configured in the topology editor by STEP 7. The
configuration and wiring match.
Topology
Set topology
Actual topology
P2
IM155-5PN
IM155-5PNST
P4 P1
P3 P2
Web server
90 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.9 Topology
"Actual topology" is OK
Shows the actual layout of all configured devices that can be reached topologically.
Topology Set topology
Actual topology
P2
IM155-5PN
IM155-5PNST
P4 P1
P3 P2
CPUX6-7-XET...
P2
P2
IM155-5PN
IM155-5PNST
P4 P1
P3 P2
Web server
Function Manual, 11/2023, A5E03484625-AK 91
Web pages
4.9 Topology
CPU1516-3PN... SCALANCE-X...
CPU1516-3PN... SCALANCE-X...
P1 P1
P2
IM155-5PN
IM155-5PNST
P4 P1
P3 P2
CPUX6-7-XET...
P2
IM155-6PN-1
IM155-6PNST
P2
IM155-5PN
IM155-5PNST
P4 P1
P3 P2
Web server
92 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.10 Tag status
Tag status
The web browser outputs the tag status on the web page of the same name.
NOTE
Saving the tag status as a bookmark
When the page is exited, the entries made on it are not saved. If you want to monitor the
same entered tags again later on, then create a bookmark in your web browser for the "Tag
status" page. Otherwise, you will have to enter the tags again when the page is reopened.
NOTE
Selected tag addresses are copied to the URL
The maximum number of characters for the URL of the tag status page is 2083. You can see
the URL which corresponds to your current tag status page in the address bar of your web
browser.
To monitor several tags, we recommend the use of the watch tables (Page 95).
Tag status
Off
① "Name"
In the "Name" text box, enter the address of the tag whose behavior you want to monitor.
This may be a symbolic or absolute address.
• PLC tags (inputs and outputs, bit memories, times and counters) and DB tags in blocks
with standard access have an absolute and a symbolic address.
• DB tags in blocks with optimized access have a symbolic address and no absolute address.
Example for access to the absolute address of a data block with standard access:
The absolute address consists of the preceding address ID %, the number of the data block
and the absolute address of the tags in the data block, separated by a period: %DB1.DBX1.0
= absolute addressing of the tags "DBX1.0" in the global data block "DB1".
Invalid entries are displayed in red font.
Web server
Function Manual, 11/2023, A5E03484625-AK 93
Web pages
4.10 Tag status
② "Display format"
Using the drop-down list box, select the desired display format for the tag. If the tag cannot
be displayed in the desired format, it will be displayed in hexadecimal format.
③ "Value"
Under "Value", the value of the corresponding operand is displayed in the selected format.
④ "Modify value"
You can change the value of tags and write them to the CPU in this column. To transfer
several changed values in one operation, click the "Apply" button below the table.
To be able to read values and write values to the CPU, you need to have configured a user
with the appropriate access rights in STEP 7.
If the value you entered is not valid (e.g. binary value in a BOOL field), the entry is not applied
and the corresponding input field remains empty. A specific message relating to this is not
output.
You can change the values of the following data types:
• Bool, Byte
• DWord, LWord, Word
• Int, DInt, LInt, SInt, UDInt, UInt, ULInt, USInt
• Real, LReal
• LDT
• Counter, Date
• Time, LTime, Time_Of_Day, LTime_Of_Day, Timer
• S5Time
• Char, WChar, String
NOTE
The following generally applies: To be able to write data, the "Referrer" transfer must be
activated in your web browser (this is the default in all common browsers).
Web server
94 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.11 Watch tables
Reference
You can find additional information on the available data types in the STEP 7 online help,
keyword: "Overview of the valid data types".
Watch tables
The browser displays the content of the configured, web-enabled watch tables on the web
page of the same name.
NOTE
Please note that you can observe a maximum of 50 of the watch tables configured in STEP 7
in the Web server.
Each of these tables is displayed in the Web server with a maximum of 200 entries.
If you are monitoring many large watch tables in the Web server, the update time may
increase due to the large data volumes.
The number of watch tables that you can monitor download into the CPU also depends on
the size of the SIMATIC memory card used.
Watch tables
VAT_1 Off
① Selection
Select one of the configured watch tables from the drop-down list.
Web server
Function Manual, 11/2023, A5E03484625-AK 95
Web pages
4.11 Watch tables
② "Name"
The symbolic name of the tag is shown in this info box.
③ "Address"
The absolute address of the tags is displayed within this info field (if present, e.g. for inputs or
outputs; DB tags in blocks with optimized access have no absolute address).
③ "Format"
Select the display format of the respective tag from the drop-down list.
⑤ "Value"
This column shows the values in the corresponding display format.
⑥ "Modify value"
You can change the value of tags and write them to the CPU in this column.
To be able to read values and write values to the CPU, you need to have configured a user
with the appropriate access rights in STEP 7.
If the value you entered is not valid (e.g. binary value in a BOOL field), the entry is not applied
and the corresponding input field remains empty. A specific message relating to this is not
output.
NOTE
The following generally applies: To be able to write data, the "Referrer" transfer must be
activated in your Web browser (this is the default in all common browsers).
Note that the comments are displayed in the project language of the STEP 7 project that is
assigned to the current user interface language of the Web server. You can find out how to
assign project languages to interface languages in section Language settings (Page 37).
Reference
You can find additional information on the available data types in the STEP 7 online help,
keyword: "Overview of the valid data types".
Web server
96 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.12 Online backup
NOTICE
Prior to every restoration of the CPU configuration, always first perform an online backup of
the current CPU configuration and save this backup file to a local directory of your PC.
This ensures that you can undo a restoration which failed (e.g. due to a damaged backup
file) or which does not show the desired result.
NOTE
You can also perform online backup and restoration of the CPU configuration in STEP 7 (see
STEP 7 online help, keyword: "Creating a backup of an S7 CPU").
When backing up using STEP 7, the backup file is saved within the STEP 7 project. With a
backup using the Web server, the backup file is saved to a local directory of your PG/PC (e.g.
"Downloads" directory). Web server backup files cannot be restored via STEP 7, nor can STEP
7 backup files be restored directly using the web server.
To restore a STEP 7 backup file using the web server, first save the STEP 7 backup file to a
local directory of your programming device/PC (e.g. "Downloads" directory). From there, you
can restore the backup with the Web server.
NOTE
The "Online backup" function is not available if you access the web server via:
• a virtual IP address
• a communication module (CM)
• a communication processor (CP)
Requirements
• You access the CPU via the secure transmission protocol "HTTPS".
• A valid CA-signed certificate is installed in the Web browser; see section Configuring the
Web server (Page 26).
Web server
Function Manual, 11/2023, A5E03484625-AK 97
Web pages
4.12 Online backup
Online backup
NOTE
During the execution of the online backup, some data is not available in the web page view
of the web server.
Web server
98 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.12 Online backup
Web server
Function Manual, 11/2023, A5E03484625-AK 99
Web pages
4.12 Online backup
6. If you have started the restoration procedure with a user name and password defined in
the Web server configuration, you will be asked to enter these again after restoration of
the CPU. Enter the required information and click "Login".
If you have started the restoration procedure as the user "Everybody"/"Anonymous"
without a password (but with appropriate access rights), this prompt is not displayed.
NOTE
To restore the configuration of an F-CPU whose security program and/or password has
been changed for the F-CPU in the meantime, you also need the access authorization
"Perform changes as F-Admin"; see "Amending user management" in the section
Configuring the Web server (Page 26).
WARNING
The authorization "Perform changes as F-Admin" on the Web server without password
protection (User "Everybody" or "Anonymous") is only for test purposes, commissioning,
etc. In other words, only when the system is not in productive operation. In this case, you
have to ensure the security of the plant through other organizational measures, e.g.
through spatial protection.
Before the transition to productive operation, you must remove the right "Perform
changes as F-Admin" from the user "Everybody" or "Anonymous".
The password of the user of the web server with the right "Perform changes as F-Admin"
must only be accessible to authorized persons.
The restoration of the CPU configuration starts and you will be continuously informed of
the current status:
– "Loading configuration."
– "Resetting CPU."
This may take a few minutes.
7. When the procedure is complete, you will be logged out and the "Reload page..." button
will be displayed.
If you did not receive an error message during the restoration procedure, the restoration
of the CPU configuration was successfully completed and you will receive a corresponding
message.
Click the "Reload page..." button and log on to the newly downloaded CPU configuration
with your user name and password.
Web server
100 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
4.13 Record
Requirements
• A trace configuration has been created, i.e. you have defined the recording and trigger
conditions and selected the signals to be recorded.
– Note: You can only display measurements stored on the SIMATIC Memory Card on the
"Record" web page.
In order for the CPU to save the measurements on the SIMATIC Memory Card, you must
make the following settings in the trace configuration in STEP 7:
1. Set the "Trigger mode" to "Trigger on tag".
2. Select the "Save measurements on device (memory card)" check box.
• You have transferred the trace configuration to the device and activated it there.
• You have been assigned the access right "The user is authorized to..." > "...query
diagnostics" in the user administration of the Web server; see section Configuring the Web
server (Page 26).
Figure 4-48 Dialog of the settings for saving measurements to the Memory Card in STEP 7
Web server
Function Manual, 11/2023, A5E03484625-AK 101
Web pages
4.13 Record
Number of measurements
The CPU supports a maximum of 999 measurements. While the CPU writes the trace
recordings to the load memory of the memory card, it pauses monitoring of the trigger
conditions for the trace job. After the CPU has terminated the storing of Trace recordings, the
CPU continues checking of the trigger conditions.
NOTICE
Memory required on the SIMATIC Memory Card
When the trace function "Measurements on device (memory card)" requires more memory
than is available on the SIMATIC Memory Card, undesired effects may result. Ensure there is
always sufficient free storage space to use the "Measurements on device (memory card)"
function.
In addition to the "Measurements on device (memory card)" Trace function, other functions,
such as storing DataLogs, use storage space on the SIMATIC Memory Card. Make sure that
enough memory space is available for all functions that occupy memory.
You can view the current values on the currently used storage space in the load memory in
the "Memory" tab on the "Diagnostics" web page.
More information
The user interface of the "Trace" web page is largely the same as that of the trace function in
STEP 7. See the Using the trace and logic analyzer Function Manual
(https://support.industry.siemens.com/cs/ww/en/view/64897128) and the online help for
STEP 7 for more details.
Web server
102 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
① Trace recordings
② Toolbar of the trend diagram
③ Trend diagram and bit trace
④ Signal tables
Figure 4-49 Trace start page without measurement
Web server
Function Manual, 11/2023, A5E03484625-AK 103
Web pages
4.13 Record
Opening measurements
To open a measurement, right-click on a measurement to select it from the "Trace recordings"
area. Then select the command "Show in chart" in the shortcut menu.
The measurement is displayed in the "Trend diagram and bit trace" area.
Web server
104 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
Trace recordings
The "Trace recordings" area shows a list of all existing measurements, sorted by date and time
of the trace recordings. A measurement always consists of a trace configuration with an
associated recording.
The following table shows the special Web server shortcut menu commands in the Trace
recordings area:
Table 4-6 Web server shortcut menu commands in the trace recordings area
Shortcut menu command Description
"Delete" Deletes the selected measurement on the memory card of the CPU. A confirmation dia
log opens.
After deletion, the display in the trend diagram is not automatically overwritten.
"Save as" Saves the selected measurement.
"Show in chart" Loads the selected measurement to the display area of the Web server.
"Add in table" Inserts the selected measurement into the table in the "Measurements" tab.
Some data types offer the display of individual bit traces. Activate the individual bit traces of
the signal opened in the signal table using the icon.
You can adjust the display of the signals in the signal table and with the aid of the toolbar of
the trend diagram.
Web server
Function Manual, 11/2023, A5E03484625-AK 105
Web pages
4.13 Record
Web server
106 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
Web server
Function Manual, 11/2023, A5E03484625-AK 107
Web pages
4.13 Record
Trend diagram
The trend diagram displays the selected signals of a recording. Bits are shown in the lower
diagram as a bit trace.
The following table shows the special Web server shortcut menu commands of a selected
signal in the trend diagram:
Table 4-8 Web server shortcut menu commands in the trend diagram area
Shortcut menu command Description
"Scale Y automatically" Automatic scaling of the selected signal in the Y direction.
"Hide signal" Hides the selected signal in the trend diagram.
Web server
108 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
① Vertical ruler
② Vertical scroll bar
③ Horizontal ruler
④ Horizontal scroll bar
Figure 4-54 Trace measurement - rulers and scroll bars
Web server
Function Manual, 11/2023, A5E03484625-AK 109
Web pages
4.13 Record
Signal tables
The signal tables list the signals of the selected measurement and provides setting options for
some properties. The area of the signal tables is divided into the tabs "Measurements",
"Signals" and "Calculated signal".
The following table shows the settings and displays of the recorded signals of the "Signals"
tab:
Column Description
Signal or error symbol
Signal symbol
Symbol for calculated signals (formulas)
Web server
110 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
Column Description
Example of an opened bit selection for the DWORD data type:
Select or deselect the relevant bit for display by clicking the icon.
Data type Display of the data type
Address Display of the address of the signal
The field remains empty with optimized / type correct tags.
Color Display and setting option for the color of the signal
Signal group Display or input of the signal group name for one signal group.
The Y-scales are scaled identically for all signals of one signal group.
Enter an identical signal group name for those signals that you want to scale identically.
To remove signals from a signal group:
• Delete the signal group name.
• Click the empty entry in the shortcut menu of the signal group.
Note that you cannot group binary signals.
Gray field for the To add or delete the signal from a signal group, move the mouse pointer over the grey field or the
chain icon of the sig chain icon ( or ),
nal group Clicking the chain icon adds the signal to a signal group or creates a new signal group.
Clicking the chain icon removes the signal from the signal group.
For a selected signal with signal group, the chain icon displays all signals of the same signal group.
Input field of the sig The input field displays the signal group name. As an alternative to the chain icon, you can assign or
nal group delete a group name via text input in this field.
Min. Y-scale Display or input of the minimum value for the scaling of the signal.
Max. Y-scale Display or input of the maximum value for the scaling of the signal.
Comment Display and input option for a comment about the signal
Y(t1) Display of the value at the position of the first measuring cursor
Y(t2) Display of the value at the position of the second measuring cursor
ΔY Display of the value difference between the first and the second measuring cursor
The following table shows the possible Web server shortcut menu commands of the "Signals"
tab:
Table 4-9 Web server shortcut menu commands of the "Signals" tab
Shortcut menu command Description
"Scale Y automatically" Automatic scaling of the selected signal in the Y direction.
"Show signal" Shows the signal in the trend diagram
"Hide signal" Hides the signal in the trend diagram
"Show all bits" Shows all the bits of a signal
"Hide all bits" Hides all the bits of a signal
"Use for determined signal" Calculates a new signal based on the selected real signal
"Process calculated signal" Switches the selected calculated signal to the editing mode.
"Delete calculated signal" Deletes the selected calculated signal
Web server
Function Manual, 11/2023, A5E03484625-AK 111
Web pages
4.13 Record
Web server
112 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
Column Description
"Save as CSV" Exports a measurement as a file with the file extension .´csv.
Note that the command only saves the measured data. The command does not save the dia
gram, snapshots, markings and calculated signals.
"Edit name" Switches the name in editing mode
"Edit offset" Switches the offset in editing mode
"Edit comment" Switches the comment in editing mode
"Delete measurement" Deletes the measurement
Web server
Function Manual, 11/2023, A5E03484625-AK 113
Web pages
4.13 Record
Enter the code for the calculation of the Y values of the signal points in the "Calculated signal
value" section. The section is divided into:
• Basic mode (expression)
• Advanced mode (JavaScript)
Use the JavaScript syntax to enter the code for both modes. Take into account, however, that
not the full JavaScript functionality is supported.
Basic mode (expression)
In this mode you use the following to create your code:
• Standardized JavaScript expressions and operators (for example +, -, /, *, %, ~, &, |, ?, !)
• Standardized math libraries
• The tag names specified under "Basic signals"
(the system writes the Y-value directly to the tag name)
Web server
114 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
The following table shows all the elements that you can use for your code:
Reserved words (case-sensitive)
if var Math Array catch typeof unescape
encodeURI in for else break escape delete
Infinity decodeURI do Date case false String
Object continue parseFloat new case true while
return Number parseInt try null isNaN throw
switch default undefined
Operators
% - *= != <= |= &&
!== + -- / > = ||
^ === ++ -= /= >= ==
& ~ += * ! < |
&= ?
Delimiters
( ) { } [ ] .
, : ;
Comments
/* */
Web server
Function Manual, 11/2023, A5E03484625-AK 115
Web pages
4.13 Record
You can also generate the JavaScript code of a real signal from the "Signals" tab. Alternatively,
you can also select one of predefined templates of the function table, change the code and
generate a calculated signal.
Web server
116 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.13 Record
To check the syntax, click the symbol "Check syntax" or generate the signal by clicking the
icon in the toolbar. If the code has any errors, these are displayed to the right of the "Check
syntax" icon in red lettering. If the code does not have any errors, the "Syntax check
successful" message is displayed.
How does the system calculate a new signal?
The system checks:
• Whether you have selected a basic signal for the calculation of a new signal
• The name of the signal to be calculated
• The syntax of your JavaScript code
Subsequently, the system defines the counting of the measuring points and executes the
code for each measuring point to be calculated. In each iteration the system stores the
measuring points of the new signal on the basis of the following four attributes:
• Measuring point
• Relative time
• Calculated Y value
• Signal point with x-, t, y-values
The course is displayed after calculation has been completed.
Example for calculating on the basis of a basic signal
You use a single basic signal to calculate the new signal. The basic signal consists of 1000
measuring points.
In this case, the system carries out your written code a thousand times. The calculated signal
then consists of 1000 calculated signal points with the same x- and t-values, but with own y-
values.
Web server
Function Manual, 11/2023, A5E03484625-AK 117
Web pages
4.13 Record
Import/export settings
You can import/export certain parameters (formulas, calculation method, signal type and
signal name. To import parameters, click the icon in the toolbar of the "Calculated signal"
tab. To export parameters, click the icon in the toolbar of the "Calculated signal" tab.
The following table shows the settings and displays of the "Managing snapshots" window.
Column Description
Static display of the snapshot icon
Web server
118 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.14 DataLogs
NOTE
Delete measurement
If you delete a measurement of a calculated signal, all the associated snapshots are also
deleted.
4.14 DataLogs
DataLogs
On the DataLogs web page, you can view all the DataLogs that you have created.
You can sort the DataLogs according to individual parameters in ascending or descending
order.
For this purpose, click on one of the parameters in the column header:
• Name
• Size
• Changed
You can download the relevant DataLog file by clicking the file name.
The "Active" column shows whether the respective DataLog file is used (is active) or not.
When the DataLog file is active, you can call (download) and empty the relevant DataLog file
by clicking the icon . The file must be closed. The empty DataLog file is still maintained in
the list of DataLogs.
You delete the DataLog file by clicking the icon in the "Delete" column. The file must be
closed.
You close an opened DataLog file in STEP 7 by using the "DataLogClose" instruction.
DataLogs
Off
Web server
Function Manual, 11/2023, A5E03484625-AK 119
Web pages
4.14 DataLogs
NOTE
Access authorization to the CPU for the reading out of data
In order to download DataLogs from the CPU, the user has to dispose of reading rights on the
CPU. If the user does not have the required rights, the CPU returns the status code 403
FORBIDDEN in the HTTP Response.
Web server
120 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.14 DataLogs
Web server
Function Manual, 11/2023, A5E03484625-AK 121
Web pages
4.15 User files
Introduction
You read and write with the instructions "FileReadC" (Compact Read Data of a File) or
"FileWriteC" (Compact Write Data to a File) in STEP 7 ASCII files (files in binary format).
Requirements
You need to save the UserFiles in the "UserFiles" directory on the SIMATIC memory card. You
specify the storage location in the path of the "FileReadC" or "FileWriteC" instruction.
Path and file name for UserFiles have to fulfill the following rules:
• The file name must not be longer than 55 characters.
• The following characters are permitted for the directory and file name: 0 to 9, a to z in
upper- and lower-case, "-" and "_"
• The path name must not start with "/", "\" or "."
• The path name must not contain ".."
Examples:
• UserFiles\Lift16_DataBase.txt
• UserFiles\2017-04-13_ErrorLog.bin
Web server
122 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.15 User files
By clicking on the icon, you can delete the UserFile. The file must be closed.
User Files
Off
NOTICE
Size UserFiles
When you open a large UserFile through this Web page, the processing times of the
instructions that process this file can increase notably.
Web server
Function Manual, 11/2023, A5E03484625-AK 123
Web pages
4.16 User pages
When the URLs are called successfully, the CPU returns the status code 200 OK. The CPU also
returns this status code if there are no UserFiles on the SIMATIC memory card.
NOTE
Access authorization to the CPU for the reading out of data
In order to download UserFiles from the CPU, the user must have reading rights for the CPU.
If the user does not have the required rights, the CPU returns the status code 403
FORBIDDEN in the HTTP Response.
User-defined pages
In the "User-defined pages" area of the Web server you can upload HTML pages you have
created yourself for reading out data of the target system.
Customer pages
NOTE
Write access to user-defined pages allows the process parameters and, thus, the operation of
the CPU to be influenced.
To prevent external manipulation, always assign a password for users with write access to
user pages in the user management. You can find information on user management in
section Configuring the Web server (Page 26) under "Amending user management".
Web server
124 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Creating user-defined pages with WinCC Unified in the TIA Portal (as of version V17)
With "View of Things" (VoT), you use WinCC Unified Engineering in the TIA Portal to create
web pages for a SIMATIC S7-1500 CPU, ET 200SP CPU or CPU 1513/1516pro and to map the
process.
You connect to the Web server of the CPU via a web browser. You can operate the objects
that you have created with WinCC Unified on the "ViewOfThings" web page.
Compared to a random HTML editor, creating and loading with WinCC Unified offers you the
following advantages:
• No HTML code expertise required; the web pages can be created as screen in the WinCC
Unified editor and then downloaded to the CPU.
• You can make changes to the user-defined pages while the CPU is in the RUN mode.
More information on creating, loading and operating user-defined pages with VoT as well as
special features in the hardware configuration, is available in the WinCC Unified online help
under the keyword "View of Things".
Web server
Function Manual, 11/2023, A5E03484625-AK 125
Web pages
4.16 User pages
3. Call the "WWW" instruction in STEP 7 and program it (see section Programming the WWW
instruction (Page 140)).
4. Configure the user page in STEP 7 (see section Configuring user pages (Page 139)). In this
way, you compile the contents of your HTML files, among other things, into data blocks.
5. Download the configuration and the user program to the CPU.
6. Open your user page with your display device by means of a web browser in the Web
server of the CPU.
NOTE
Extensive HTML pages, especially those with a lot of images, take up a lot of space in the
load memory. Make sure you select a SIMATIC memory card with enough storage space to
provide sufficient load memory.
If the sum of the HTML pages > 1 MB, performance losses may occur as only 1 MB data is
saved in the cache.
We recommend that you create each individual file of an HTML page with a size not
exceeding 512 KB; otherwise, problems can occur when sending the file from the Web
server to the web browser. You can view the size of the respective file in the file explorer
of the directory.
NOTE
If the HTML page contains form fields for data input, automatic update can impair the correct
data input by the user.
To update the entire page automatically, you can add the following instruction to the <head>
area of your HTML page, whereby the number "10" stands for the update interval in seconds:
<meta http-equiv="refresh" content="10">
References
The description of a user page is available in the section Example of a user page (Page 144).
Additional help for visualization with user-defined pages is available in the application
examples on the Internet:
• Creating and using your own web pages for S7-1200
(https://support.automation.siemens.com/WW/view/en/58862931)
• Creating and using your own web pages for S7-1200 / S7-1500
(https://support.industry.siemens.com/cs/de/en/view/68011496)
• Visualizing with user-defined web pages on SIMATIC CPUs with PROFINET interface
(https://support.automation.siemens.com/WW/view/en/44212999)
• How do you integrate the string contents in your user-defined web page of the S7-1500
CPU as of Firmware V1.6?
(https://support.industry.siemens.com/cs/ww/en/view/98754370)
Web server
126 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
You will find more information on JavaScript commands in the ECMAScript specification on
the Internet (https://www.ecma-international.org/ecma-262/5.1/).
For more information about how to automatically update web pages and how to incorporate
user-defined pages with relative path names, refer to the FAQ with entry ID 62543256 on the
Service&Support (https://support.industry.siemens.com/cs/ww/en/view/62543256) Internet
page.
Overview
Automation Web Programming (AWP) commands are a special command syntax for
exchanging data between the CPU and the customer page (HTML file).
AWP commands are entered as HTML comments and offer you the following options for your
customer pages:
• Reading PLC tags
• Writing PLC tags
• Reading special tags
• Writing special tags
• Defining enum types
• Assigning enum types to tags
• Defining data block fragments
• Importing data block fragments
• Accessing the values of an array
• Accessing the values of a PLC tag of the data type STRUCT
General syntax
All AWP commands, except for the command for reading a PLC tag, have this structure:
<!-- AWP_< command name and parameter> -->
Files including AWP commands:
• must be UTF-8 encoded.
To define UTF-8 as the character set of the page, include the following line in your HTML
code:
<meta http-equiv="content-type" content="text/html; charset
utf-8">
NOTE
Saving the HTML page
Make sure that you save the file in the editor in UTF 8 character encoding as well.
Web server
Function Manual, 11/2023, A5E03484625-AK 127
Web pages
4.16 User pages
Web server
128 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Examples
:="Conveying speed":
:="My_datablock".bitmemory1:
:=%MW100:
Web server
Function Manual, 11/2023, A5E03484625-AK 129
Web pages
4.16 User pages
In this context, note in particular that the character string with double quotation marks is not
identical to two single quotation marks even if they appear to be identical.
NOTE
The code is not adapted automatically during an update to firmware as of V1.6.
Adapt your HTML code if you have used single quotation marks to enclose attributes for the
"Read PLC tags" function.
6HTXHQFH 6HTXHQFH
Figure 4-68 Example of HTML code with attribute in single quotation marks
NOTE
Write access during operation
In order for data to be written to the CPU from a user page, a user with corresponding write
rights must be set up and the user must be logged in as this user. This applies to all write
accesses of web pages to the CPU.
Syntax
<!-- AWP_In_Variable Name='"<Varname1>"' Name='"<Varname2>"'
Name='"<Varname3>"' -->
If the name of the tag that you are using for the web application is not identical with the
name of the PLC tag, you can assign it to a PLC tag with the "Use" parameter.
<!-- AWP_In_Variable Name='<Varname_Webapp>' Use='<PLC_Varname>' -->
Web server
130 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Special tags
The special tags are mainly the so-called HTTP tags that are defined in the definitions of the
World Wide Web Consortium (W3C). Special tags are also used for cookies and server tags.
Web server
Function Manual, 11/2023, A5E03484625-AK 131
Web pages
4.16 User pages
Examples
The HTTP HEADER tag is written to the PLC tag of the same name:
<!-- AWP_Out_Variable Name='"HEADER:Status"' -->
If the name of the special tag is not identical with the name of the PLC tag, you can assign it
to a PLC tag with the "Use" parameter:
<!-- AWP_Out_Variable Name='"HEADER:Status"' Use='"Status"' -->
Web server
132 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Examples
The HTTP SERVER tag is written to the PLC tag of the same name:
<!-- AWP_In_Variable Name='"SERVER:current_user_id"' -->
The HTTP SERVER tag is written to the PLC tag "My_User ID":
<!-- AWP_In_Variable Name='"SERVER:current_user_id"'
Use='"My_User-ID"' -->
Examples
To store German values as HTML file in the "de" folder of the HTML directory:
<!-- AWP_Enum_Def Name="Enum1" Values='0:"an", 1:"aus", 2:"Störung"'
-->
To store English values as HTML file in the "en" folder of the HTML directory:
<!-- AWP_Enum_Def Name="Enum1" Values='0:"on", 1:"off", 2:"error"'
-->
Web server
Function Manual, 11/2023, A5E03484625-AK 133
Web pages
4.16 User pages
4.16.1.4 Fragments
Fragments
Fragments are "logical sections" of a web page to be processed by the CPU individually.
Fragments are usually entire pages, but they can be individual elements, such as files (e.g.
images) or documents.
NOTE
In each fragment in which enum texts are referenced by a PLC tag, this PLC tag must be
assigned to the enum type name with the appropriate AWP command.
Web server
134 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Defining fragments
A fragment extends to the beginning of the next fragment or to the end of the file.
Syntax
<!-- AWP_Start_Fragment Name='<Name>' [Type="<Typ>"] [ID="<Id>"]
[Mode="<Mode>"] -->
This command specifies the start of a fragment.
• <Name> Specifies the name of the fragment. The name must start with a letter [a‑zA‑Z] or
an underscore ( _ ). This first character can be followed by letters, underscores or numbers
[0-9].
• <Type> Specifies the type of the fragment.
– "automatic": The page is edited automatically (default)
– "manual": Do not use this fragment type. Use the preset fragment type "automatic".
• <Id> You can specify a numerical ID for the fragment. If no ID is assigned, the fragment is
automatically assigned an ID. For manual pages (<Type>=manual), the fragment can be
addressed with this ID in the user program of the CPU.
NOTE
ID assignment
Set the ID as low as possible because the highest ID influences the size of the Web control
DB.
• <Mode>
– "visible": The contents of the fragment are displayed on the user page (default).
– "hidden": The contents of the fragment are not displayed on the user page.
Importing fragments
You can specify a fragment in an HTML page and import this fragment into other websites.
NOTE
Ensure that no AWP command for importing fragments is positioned between an enum
assignment and enum usage, because this import can result in the enum assignment being
located in a different fragment than the enum usage.
Example
A company logo is to be displayed on all websites of a web application.
The HTML code for the fragment that displays the company logo exists only once. You can
import the fragment as many times and into as many HTML files as required.
Syntax
<!-- AWP_Import_Fragment Name='<Name>' -->
<Name> corresponds to the name of the fragment to be imported.
Web server
Function Manual, 11/2023, A5E03484625-AK 135
Web pages
4.16 User pages
Example
HTML code within a web page that creates a fragment for displaying an image:
<!-- AWP_Start_Fragment Name='Mein_Firmenlogo' -->
<p><img src="CompanyLogo.jpg"></p>
HTML code that imports the created fragment into another web page:
<!-- AWP_Import_Fragment Name='My_Company_Logo' -->
4.16.1.5 Arrays
Arrays
The Web server provides the user program commands AWP_Start_Array and AWP_End_Array
for accessing all values of an array.
Only one-dimensional arrays are supported.
Multidimensional arrays of the form array[x][y] are not supported.
Syntax
<!-- AWP_Start_Array Name='"<DB name>".<array name>' -->
... Content of the array, utilized keywords: ArrayIndex and value..
<!-- AWP_End_Array -->
Parameter
• <Name> defines the name of the array with the elements you want to access.
– You require the DB name and the name of the array corresponding to the data block
structure defined in STEP 7.
– The name must be within single or double quotation marks.
– The DB name is within double quotation marks.
• <ArrayIndex> Index of an array element
• <value> Value of an array element
Example
The example reads all elements of the "MyArray" structure in the "DB_Name" data block of the
CPU and displays the index and the values of the tags on the user-defined web page.
Web server
136 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
4.16.1.6 Structures
Structures
The web server provides AWP commands for accessing structures in order to access the
values of a PLC tag of the data type STRUCT.
Syntax
<!-- AWP_Start_Struct Name='"<DB name>".<struct name>' -->
... Content of structure ...
<!-- AWP_End_Struct -->
Web server
Function Manual, 11/2023, A5E03484625-AK 137
Web pages
4.16 User pages
Parameter
• <Name> defines the name of the structure with the elements you want to access.
– You require the DB name and the name of the structure corresponding to the data
block structure defined in STEP 7.
– The name must be within single or double quotation marks.
– The DB name is within double quotation marks.
Example
The example reads elements of the "MyStruct" structure in the "DB_Name" data blocks of the
CPU and displays the value of the tag on the user-defined web page.
Web server
138 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Web server
Function Manual, 11/2023, A5E03484625-AK 139
Web pages
4.16 User pages
8. Click the button ④ "Create blocks" to create data blocks from the source files. The
generated data blocks are stored in the STEP 7 project tree in the folder "System blocks >
Web server". These data blocks consist of a control data block (Web control DB) that
controls the display of the webpages and one or several data block fragments (fragment
DBs) with the compiled webpages.
9. In the network view, select the CPU to be loaded and then select the "Download to device"
command in the "Online" menu to download the blocks. The compilation of the blocks is
implicitly triggered before the download. If errors are signaled during this process, they
must be remedied before you can download the configuration.
NOTE
DB number of the web control DB.
If you change the DB number of the DB 333, the user pages in the Web server can no longer
be reached at renewed downloading into the CPU. Error code W#16#007F is output at the
parameter RET_VAL. Therefore observe the default setting DB 333 for the Web Control DB.
If you want to change the DB number nevertheless, you have to switch the CPU POWER-OFF
→ POWER ON, so that the user pages in the Web server can be reached.
NOTE
Calling the WWW instruction
You have created your user page in an HTML editor of your choice.
• Use automatic HTML pages if you want to deactivate control of the page layout by means
of the user program (requires at least one call of SFC 99) Operating mode changes from
RUN to STOP do not affect the call of the user-defined pages.
• Use manual HTML pages if you want to enable control of the page layout by means of the
user program (cyclic call of SFC 99 required).
Web server
140 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Parameters
The following table shows the parameters of the WWW instruction.
RET_VAL parameter
Web server
Function Manual, 11/2023, A5E03484625-AK 141
Web pages
4.16 User pages
/RJR
3DJH
ವ6XE3DJH
ವ6XE3DJH
0\3DJH
3DJH
3DJH
Figure 4-70 Example of customer page as start page of the Web server
Requirements
The following requirements must be met before the customer page is displayed as the start
page of the Web server:
• You have configured the customer page as the start page.
• You have configured a user in STEP 7 whom you have assigned at least the authorization
"... open customer web pages".
• The CPU is in RUN mode.
Web server
142 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Procedure
To define the customer pages in STEP 7 as the start page of the Web server, proceed as
follows:
1. Select the CPU in the device configuration.
2. Open the settings in the Inspector window of the CPU under "Properties > General > Web
server".
3. Select the entry "AWP1" in the area "Entry page" under "Select entry page".
Reference
You can find additional information on the topic of customer page as start page in the FAQ
with entry ID 67184104 on the Service&Support
(https://support.industry.siemens.com/cs/ww/en/view/67184104) Internet page.
Web server
Function Manual, 11/2023, A5E03484625-AK 143
Web pages
4.16 User pages
Web server
144 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Files used
Three files are used in the application example:
• Wind_turbine.html: The user page in the figure shown above. The control data is accessed
by AWP commands.
• Wind_turbine.css: The Cascading Style Sheet which includes the formatting specifications
of the user page. The use is optional but can simplify the design of the user page.
• Wind_turbine.jpg: The background image displayed on the user page. The use of images is
optional, user pages with lots of images require a lot more memory in the load memory.
These files are not part of your installation but they are described as an example below.
Web server
Function Manual, 11/2023, A5E03484625-AK 145
Web pages
4.16 User pages
Implementation
The user page uses AWP commands to read out values from the CPU as well as writing values
to it. The user page also uses AWP commands for the definition of enum types, such as the
assignment of tags to enum types for handling the ON/OFF settings.
The user page is structured as follows:
① Header of the website with number and location of the wind turbine.
② Atmospheric conditions at the turbine, wind speed, wind direction and current temperature
are displayed.
③ Read-out power output.
④ Manual override: Activates manual override of the turbine. To make manual settings for speed,
orientation and angle of attack, the STEP 7 user program requires that manual override has
been activated.
⑤ Override of the orientation: Activates manual override of the turbine orientation.
⑥ Override of the angle of attack: Activates manual override of the angle of attack of the rotor
blades.
⑦ By clicking this button, you transfer the override settings to the CPU.
⑧ Manual setting of a percentage value for braking. The setting "Manual override" is not required
to enter a brake value.
Figure 4-73 Overview of user page wind turbine
In addition, the user page uses an AWP command that writes the special tag to the tag table.
The tag table contains the ID of the user who is currently accessing the page.
Web server
146 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
Example of HTML code for reading and displaying data from the CPU
This part of the HTML code is used to display the power output on the user page.
On the left-hand side the "Power Output": text is displayed, on the right-hand side, the value
of the tags for the power output including the unit ("KW").
The AWP command :="Data_block_1".PowerOutput executes the read operation. The
data block is referenced here by its symbolic name and not by its number ("Data_block_1"
instead of "DB1").
The code used in the example is:
<tr style="height:2%;">
<td>
<p>Power output:</p>
</td>
<td>
<p style="margin-bottom:5px;"> :="Data_block_1".PowerOutput: KW</p>
</td>
</tr>
NOTE
Assignment of enum types
If the user page writes into a tag by using an enum type, there has to be a declaration
"AWP_In_Variable" for each "AWP_Enum_Ref" declaration.
Web server
Function Manual, 11/2023, A5E03484625-AK 147
Web pages
4.16 User pages
Setting options
The user page "Remote Wind Turbine Monitor" includes different AWP commands for writing
data into the controller. A user with the corresponding access permissions can control the
wind turbine manually, activate the override for the turbine speed and the turbine orientation
as well as the angle of attack of the rotor blades with the declaration of different
"AWP_In_Variable" write commands. The user can also specify floating-point numbers for
turbine speed, orientation angle of attack and percentage of braking. The user page uses an
HTTP command in the format "POST" to write the tags into the controller.
The code used in the example for setting the brake value is:
<!-- AWP_In_Variable Name='"Data_block_1"' -->
...
<tr sytle="vertical-align: top; height: 2%;">
<td style="width: 22%;"><p>Braking:</p></td>
<td>
<form method="POST">
<p><input name='"Data_block_1".Braking' size="10" type ="text">
%</p>
</form>
</td>
</tr>
This excerpt from the HTML code first defines a "AWP_In_Variable" for the "Data_block_1"
data block which enables the user page to write any number of tags into the data block. The
text "Braking:" is displayed on the left-hand side; on the right-hand side is a box in which the
user can make entries for the "Braking" tag in the data block.
Web server
148 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.16 User pages
The user page reads out the actual braking value from the controller and displays it in the text
box. A user with the corresponding access permissions can then write a brake value that
controls the braking process into the data block of the CPU.
NOTE
Declaration of data blocks
If you declare an entire data block by means of a "AWP_In_Variable", each tag in the data
block can be written by means of the user page. If only certain tags in the data block are to be
writable, you declare this specifically using <!-- AWP_In_Variable
Name='"Data_block_1".Braking' -->, for example.
4.16.5.6 HTML code of the user page "Remote Wind Turbine Monitor"
Example
You can find the complete HTML code of the sample customer page "Remote Wind Turbine
Monitor" as well as the used Cascading Style Sheet (CSS) on the Internet
(https://support.industry.siemens.com/cs/ww/en/view/107623221/71849346059).
Web server
Function Manual, 11/2023, A5E03484625-AK 149
Web pages
4.17 Filebrowser
4.17 Filebrowser
Requirements
Access rights must be assigned for the user in the user management.
Filebrowser
The contents of the SIMATIC memory card are displayed by the browser on the "Filebrowser"
web page. This means, for example, that you can read and edit the log files generated by the
CPU without having to use STEP 7.
Filebrowser
S7-1500/ET200MP station 1 /
Name Size Changed Delete Rename
LOG 32768 00:39:08 05/03/2012
cdrinfo.bin 512 00:39:08 05/03/2012
UserFiles 09:56:30 24/10/2017
recipes 09:56:30 24/10/2017
datalogs 09:56:30 24/10/2017
Directory operations:
Upload file
NOTE
The Filebrowser only grants you read access to the “DataLogs”, "Backups" and “UserFiles”
directories.
Web server
150 Function Manual, 11/2023, A5E03484625-AK
Web pages
4.19 Basic websites
Procedure
1. Enter the following address in the address bar of your web browser:
"https://<CPU IP address>/save_service_data", e.g.
"https://192.168.3.141/save_service_data"
2. Your screen displays the service data page with a button for saving the service data.
3. Save the service data locally on your display device by clicking on "Save ServiceData".
Result
The data is stored in a .dmp file with the following naming convention: "<MLFB><Serial
number><Time stamp>.dmp." The user can change the file name at a later time.
NOTE
If you have defined your customer page as the start page, observe the note on reading out
service data in section Defining the user page as start page (Page 142).
Web server
Function Manual, 11/2023, A5E03484625-AK 151
Web pages
4.19 Basic websites
Web server
152 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface) 5
Web API
The CPU offers you a Web-based API (Web API) as an interface for reading and writing CPU
data.
The Web API enables you to:
• Implement web applications at the latest state-of-the-art technology
• Communicate with the Web server of the CPU via script and programming languages
• Create web applications that connect to multiple CPUs at the same time, for example, to
create dashboards that visualize the status of multiple CPUs
:HE$3,
① CPU
② Terminal devices
Figure 5-1 Web API
Communication between the CPU and the terminal device takes place via PROFINET or WLAN
integration.
NOTE
Security information
Please note that the following graphic only shows the role of the Web API between CPU and
terminal device.
For the correct setup of a secure WLAN connection, observe the Security Information in the
preface of this manual.
Web server
Function Manual, 11/2023, A5E03484625-AK 153
API (Application Programming Interface)
Requirements
The Web API can only be used for CPUs as of firmware version from V2.8 for the following
systems:
• The standard F and T-CPUs of the automation system S7‑1500
• The CPUs 1504D TF and 1507D TF of the SIMATIC Drive Controller
• The CPUs of the ET 200pro distributed I/O system
• The standard F and T-CPUs of the distributed I/O system ET 200SP
• The standard F and T-CPUs of the S7-1500 software controller
• As of firmware version V3.1, the R/H-CPUs of the automation system S7-1500
The following requirements must be met before you can use the Web API.
• You have assigned the correct firmware version (≥ V2.8) in the Hardware catalog of
STEP 7.
• You have created and configured a project and downloaded it to the CPU.
• You have ensured that the following check box is selected in STEP 7:
– Activate Web server on this module
Overview of the Web API methods depending on the firmware version of the CPU
The Web API is being continuously extended. The following table shows the mechanisms and
methods you can use with a specific firmware version of the CPU:
Web server
154 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
Web server
Function Manual, 11/2023, A5E03484625-AK 155
API (Application Programming Interface)
Web server
156 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
Table 5-1 Overview of web applications that can be loaded by the user
Web applications that can be loaded by the Standard/T-CPU F-CPUs as of R/H-CPUs as of
user (Page 250) as of firmware firmware ver firmware version
version sion
WebApp.Create (Page 254) V2.9 V2.9 -
WebApp.Delete (Page 255) V2.9 V2.9 -
WebApp.Rename (Page 256) V2.9 V2.9 -
WebApp.Browse (Page 257) V2.9 V2.9 -
WebApp.SetState (Page 259) V2.9 V2.9 -
WebApp.SetDefaultPage (Page 260) V2.9 V2.9 -
WebApp.SetNotFoundPage (Page 261) V2.9 V2.9 -
WebApp.SetNotAuthorizedPage (Page 262) V2.9 V2.9 -
WebApp.BrowseResources (Page 264) V2.9 V2.9 -
WebApp.CreateResource (Page 266) V2.9 V2.9 -
WebApp.DeleteResource (Page 268) V2.9 V2.9 -
WebApp.RenameResource (Page 269) V2.9 V2.9 -
WebApp.DownloadResource (Page 270) V2.9 V2.9 -
WebApp.SetResourceVisibility (Page 271) V2.9 V2.9 -
WebApp.SetResourceETag (Page 273) V2.9 V2.9 -
WebApp.SetResourceMediaType (Page 274) V2.9 V2.9 -
WebApp.SetResourceModificationTime (Page V2.9 V2.9 -
275)
Web server
Function Manual, 11/2023, A5E03484625-AK 157
API (Application Programming Interface)
API endpoint
As an RPC protocol, JSON-RPC V2.0 is based on HTTP. The Web API can be reached via POST
Requests to the following URL:
https://[ip]/api/jsonrpc
The Web API supports bulk operations as defined in JSON-RPC 2.0. While bulk operations are
not explicitly limited by a fixed number of method calls, there is a limit for the HTTP request
body. The limit differs depending on the firmware version of the CPU:
• Limit of 64 KB for CPUs with firmware version ≤ V3.0
• Limit of 128 KB for CPUs as of firmware version ≥ V3.1
As of firmware version V3.1, you can use the API method Api.GetQuantityStructures to read
the limit.
An example of the required structure of an HTTP Request and HTTP Response for successfully
making a Web API request can be found in the chapter Web API integration (Page 160).
Compatibility with regard to future extensions of the Web API
The order of attributes within a JSON object does not affect API clients.
Web server responses to requests via the API may be extended with new JSON attributes in
future firmware versions, e.g. to enrich results with more details.
Error codes of possible API error messages based on JSON-RPC may change in future firmware
versions, if applicable, and existing error messages may be made more precise.
NOTE
To check if your API request was successful, first check if the request was successful in
general. You can evaluate the JSON-RPC error codes for detailed information.
Textual error information only provides information. If you want to implement error
evaluation in a way specific to an application, use the corresponding numeric error codes of
the error message.
The precision of floating point values may differ in the display from other clients, such as the
TIA Portal.
Bulk requests are always processed in descending order, whereby the individual requests are
contained in the HTTP request body in descending order.
If an API method includes time stamps, these time stamps are always returned based on UTC
time. Examples of this are the time stamps of the Files.Browse and Api.BrowseTickets
methods. With the API methods Plc.ReadSystemTime and Plc.ReadTimeSettings, you can read
out the system time and determine the PLC local time.
Web server
158 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
Supported clients
The products and versions listed in the following table were tested for the Web API. The
column "As of Version" lists the tested version as of which the clients are supported:
Product * As of Version Supported functions
Chrome-based Desktop web browser (e.g. Google 75.x Web API access with JavaScript for asyn
Chrome) (https://chromium.woolyss.com/) (Windows and Android) chronous requests
Mozilla Firefox (https://www.mozilla.org/en- 64.x (long-term support)
US/firefox/)
Microsoft Internet Explorer 11.x
(Windows 7, Windows 10)
Microsoft Edge 44.x
Windows 10
Apple Safari 12.x
iOS
Opera 58.x
SIMATIC HMI Panels 2
Microsoft C# (https://docs.microsoft.com/en- .Net Framework 4.7 Web API access for pure HTTP requests
us/dotnet/api/system.net. and Json.Net for generating and parsing
webrequest?view=netframework-4.7.2) with content
WebRequest class and Json.Net library
(https://www.newtonsoft.com/json)
GNU Wget (https://www.gnu.org/software/wget/) 1.20 Web API access for pure HTTP requests,
Windows e.g. for automatic archiving of
DataLogs.
cURL (https://curl.haxx.se/) 7.63.x
Windows
Python (https://www.python.org/downloads/) 3.10
Microsoft PowerShell 5.0 Web API access for pure HTTP Requests
with Invoke WebRequest and
ConvertTo-Json/ConvertFrom-Json for
generating and parsing content
WebserverApi Client Library for .NET 1.0.1 Web API access for pure HTTP requests
(https://github.com/siemens/simatic-s7-webserver- in C#. The library is also available as a
api) NuGet package at the following address
(https://www.nuget.
org/packages/Siemens.Simatic.
S7.Webserver.API).
* Not included in the scope of delivery of the product described here
Github
You can also find examples of using API methods in practice on Github at the following repos
itory (https://github.com/siemens/simatic-s7-webserver-api).
Web server
Function Manual, 11/2023, A5E03484625-AK 159
API (Application Programming Interface)
5.1 Web API integration
[{"jsonrpc":"2.0","method":"Api.Login","params":{"user":"User1","pa-
ssword":"SecurePassword"},"id":999}]
HTTP/1.1 200 OK
Content type: application/json
Cache-Control: no-cache
Pragma: no-cache
Expires: 0
Access-Control-Allow Origin: *
Access-Control-Allow Headers: Content-Type,X-Auth Token
Access-Control-Allow Methods: POST,OPTIONS
transfer-encoding: chunked
date: Tue, 23 Apr 2019 17:50:31 GMT
[{"jsonrpc":"2.0","id":999,"result":{"token":"Sy8pe3VNv86rTMldzFBsY-
zmw12Lg"}}]
NOTE
Information used in the examples
Note that the names of the methods, parameters and the JavaScript code are specified
without liability and can deviate from the current API methods.
Web server
160 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.1 Web API integration
Example 1
Example 1 shows a code section that wants to maintain a session with JavaScript. For this
purpose, a one-time ping request is sent using the Api.Ping method. If the intervals at which
the ping request is sent are less than the timeout of 2 minutes, the user remains permanently
logged in.
A maintained session lends itself to scenarios such as operating and monitoring tasks.
$.post({
url:"https://192.168.2.132/api/jsonrpc",
headers:{
'X-Auth-Token':"Sy8pe3VNv86rTMldzFBsYzmw12Lg"
},
data:JSON.stringify({"jsonrpc":"2.0", method:"Api.Ping", "id":1}),
success:function(data){ console.log(data); }
dataType:"text",
contentType:"application/json"
});
NOTE
X-Auth-Token
To extend the session, you must send the token (X-Auth-Token) as an HTTP header to the
CPU.
When you call the Api.Ping method without a token, the session is not extended because the
CPU cannot assign a token to the user.
Example 3 shows an example of a token in the HTTP request.
In the example, the selected user has the necessary authorizations. The methods after the
login request were successfully carried out, as the following result shows.
{"jsonrpc":"2.0","id":1,"result":"ZWlmbnJwZmplb3Nwd2l1Y3N3dWE="}
Example 2
Example 2 shows a client that wants to log in to the CPU with JavaScript and calls several
methods within an HTTP request using a bulk request.
$.post({
url:"https://192.168.2.132/api/jsonrpc",
data:JSON.stringify([
{"jsonrpc":"2.0", "id":1, method:"Api.Login",
params:{user:"Admin",password:"12345"} },
{"jsonrpc":"2.0", "id":2, method:"Api.GetPermissions" },
{"jsonrpc":"2.0", "id":3, method:"Api.Browse" }]),
success: function(data){ console.log(data); },
dataType: "text",
Web server
Function Manual, 11/2023, A5E03484625-AK 161
API (Application Programming Interface)
5.1 Web API integration
contentType: "application/json"});
The following section shows an example of a bulk request response. The selected user has
the necessary authorizations. The methods after the login request were successfully carried
out with the authorizations of the authenticated user.
[
"jsonrpc": "2.0", "id": 2, "result":[
{ "name": "Api.Browse" },
{ "name": "Api.Login" },
{ "name": "Api.Logout" },
{ "name": "Api.GetPermissions" },
{ "name": "PlcProgram.Read" },
{ "name": "PlcProgram.Write" }
]
Example 3
Example 3 shows a bulk request for read and write access to a stack of tags in a single HTTP
request. This procedure is recommended for bulk requests, as it is more efficient than a series
of single accesses and therefore places less load on the CPU.
$.post({
url:"https://192.168.2.132/api/jsonrpc",
data:JSON.stringify([
{"jsonrpc":"2.0", "id":1, method:"PlcProgram.Read"},
{"jsonrpc":"2.0", "id":2, method:"PlcProgram.Read",
params:{"var":"\"MyDB\".InvalidField"}},
{"jsonrpc":"2.0", "id":3, method:"PlcProgram.Read",
params:{"var":"MyDB.MyDate"} },
{"jsonrpc":"2.0", "id":4, method:"PlcProgram.Write",
params:{"var":"\"BoilerControl\".TempSetPoint", value:9001} }]),
success: function(data){ console.log(data); },
dataType: "text",
contentType: "application/json",
headers: {
"X-Auth-Token":"d29kamV3cGxtdm5keHNhcXd1aXJ0empkZXN3cQ=="}});
The bulk request contains an invalid tag with an error message providing information about
this. All other methods were successfully carried out, as the following result shows.
[
{"jsonrpc":"2.0","id":1,"result":{"value":42}},
{"jsonrpc":"2.0","id":2,"error":{"code":201,"message":"Invalid
address"}},
{"jsonrpc":"2.0","id":3,"result":{"value":"1990-01-01"}},
Web server
162 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.2 Web API sessions
{"jsonrpc":"2.0","id":4,"result":true}
]
NOTE
If a Web API call is not made within a session before 120 seconds have elapsed, the CPU
terminates the session with a logout event. A timeout reset is initiated by every successful
action of the user in which a toke is supplied.
Call the Api.GetPermission or Api.Ping method cyclically within the timeout grid to ensure
that:
• Your session remains active
• Your authorizations for the call of other methods remain active
If you request another authentication token and none are available, then the request is
rejected.
Web server
Function Manual, 11/2023, A5E03484625-AK 163
API (Application Programming Interface)
5.3 Ticket mechanism
Security events
The following applies to configured CPUs with firmware version ≤ V3.0: The CPU generates a
security event for successful and failed logins. The CPU enters this security event in the
diagnostics buffer.
For configured CPUs with firmware version ≥ V3.1, security events are logged in the CPU's
internal syslog buffer. You can read out the entries with the Syslog.Browse (Page 222)
method.
You can find more information about syslog messages in the Communication function manu
al (https://support.industry.siemens.com/cs/ww/en/view/59192925).
NOTE
4 tickets per session
The ticket mechanism enables you to use up 4 tickets simultaneously per session.
The number of tickets that can be created per type is additionally limited. For more
information, see the API methods that create a ticket:
• WebApp.CreateResource (Page 266)
• WebApp.DownloadResource (Page 270)
• Plc.CreateBackup (Page 229)
• Files.Download (Page 237)
• Files.Create (Page 238)
• PlcProgram.DownloadProfilingData (Page 194)
Web server
164 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.3 Ticket mechanism
8FC"1*3FRVFTU
HTTP 200 OK
Success
ticket=MzQ1Njc4OTAxMjM0NTY2ODkwMTIz
5JDLFU3FRVFTU
HTTP 200 OK
%BUB XJUIEPXOMPBE
① To request the upload or download of a resource from/to the CPU, a client sends a request
to the JSON-RPC.
② After successful authorization and resource check, the client receives a valid ticket ID.
③ The client sends a request to the ticket end point with the valid ticket ID and an
X-Auth-Token. The data is included here during upload to the CPU. The request is confirmed
to the client with "HTTP 200 OK" or "204 No Content". The data is returned in a download
from the CPU.
Ticket IDs are one-time tokens that may not be reused by the client or by the CPU after being
redeemed.
NOTE
Changes in firmware version V3.0
As of firmware version V3.0, no X-Auth-Token is required for the ticket end point.
Do not share the token with third parties, because the owner of the token gets control over a
ticket.
As of firmware version V3.0, GET requests for downloads are possible in addition to POST
requests. For GET requests, a content disposition header is returned with the HTTP response.
It contains a default file name for storage in the web browser. The browser uses the file name
as the storage location. However, you can also evaluate the file name programmatically using
a programming language (for example, via C#).
Web server
Function Manual, 11/2023, A5E03484625-AK 165
API (Application Programming Interface)
5.3 Ticket mechanism
NOTE
In some cases, programming languages perform preprocessing of text files before the
upload. For example, a UTF-8 BOM-encoded (Byte Order Mark) file in Javascript is converted
to a UTF8 file in advance.
Examples
Below you will find two examples for further processing of the tickets. The examples use
HTML, Json and JQuery library.
WebApp.CreateResource (upload a resource):
<td><input id="fileForticketCustomerExampleUpload" type="file"
onchange="fReadFile()" /></td>
var fileReader = new FileReader();
function fReadFile() {
fileReader = new FileReader();
fileReader.readAsText(this.files[0]);
}
$("#ApiUploadticketCustomerExample").click(function () {
var ticketId = $("#iApiUploadticketIdCustomerExample").val();
var content = fileReader.result; // e.g. <!DOCTYPE
html><html><head>...
$.post({
url: "https://" + window.location.hostname +
"/api/ticket?id=" + ticketId,
headers: { "X-Auth-Token": token, "Content-Type":
"application/octet-stream" },
contentType: "application/json",
data: content,
Web server
166 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.3 Ticket mechanism
Web server
Function Manual, 11/2023, A5E03484625-AK 167
API (Application Programming Interface)
5.3 Ticket mechanism
});
Ticket methods
Two methods are available for handling your tickets as an authenticated user:
• You can use the Api.BrowseTickets (Page 168) method to find out which tickets are
currently active for you and read out the status for the active tickets in each case.
• After the action, you can delete your ticket with the Api.CloseTicket (Page 170) method to
clean the application with regard to active tickets.
5.3.1 Api.BrowseTickets
The Api.BrowseTickets method calls the status of all active tickets of a logged-in user.
Alternatively, the status of a specific ticket can be called. This will provide information on the
ticket status. You can also call this method during an active file action to retrieve the current
status. Depending on the file action, additional information is provided by Api.BrowseTickets.
To call the Api.CloseTicket method, you do not need an authorization but you do need a valid
session token. You can find information on the session token in the section Api.Login (Page
171).
Example
In the following example, a ticket ID is transferred as parameter.
{
"id": "U2VyaW91c2x5LCBTdG9wIGl0ISE6"
}
Web server
168 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.3 Ticket mechanism
Response structure
The following table shows you the structure of the server response to a successful request.
Table 5-3 Api_BrowseTickets_Response (object)
Name Required Data type Description
max_tickets yes number Maximum number of tickets for one session (4)
tickets Yes array of Api_ Ticket ID
BrowseTickets_
Ticket_
Response
id yes string Ticket ID
date_created yes string ISO8601 time stamp as string.
Time of the ticket creation based on the CPU time
provider yes string Name of the method that has created the ticket, for
example, WebApp.DownloadResource
state yes string Current ticket status. The following alternatives are pos
sible: "created", "active", "", "completed" or "failed"
data No object Additional ticket data:
Some ticket-based methods offer users additional
information. This additional information is provided via
"data" and described in the sections of the respective API
methods.
Example
A response is shown in the following example.
{
"max_tickets": 4,
"tickets":
[
{
"id": "U2VyaW91c2x5LCBTdG9wIGl0ISE6",
"date_created": "2021-01-15T08:00:00-05:00",
"provider": "WebApp.DownloadResource",
"state": "active"
}
]
}
NOTE
Additional ticket data (as of version V18)
As of version V18, each ticket is extended by the entry "bytes_processed" as part of the "data"
object. This entry specifies how many bytes have been transferred when downloading or
uploading a ticket until the Api.BrowseTicket method is called.
Web server
Function Manual, 11/2023, A5E03484625-AK 169
API (Application Programming Interface)
5.3 Ticket mechanism
5.3.2 Api.CloseTicket
You use the Api.DeleteTicket method to delete a ticket provided by the system that is
assigned to the current user session.
To call the Api.CloseTicket method, you do not need an authorization but a valid session
token. You can find information on the session token in the section Api.Login (Page 171).
Example
In the following example, a ticket ID is transferred as parameter.
{
"id": "U2VyaW91c2x5LCBTdG9wIGl0ISE6"
}
Response structure
If successful, the method returns the Boolean value "true".
Web server
170 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.4 Web API basic functions
NOTE
Files which contain Web API methods must be encoded and stored in the UTF-8 character
encoding.
For detailed examples of an integration of the Web API into your web application, refer to the
section Web API integration (Page 160).
5.4.1 Api.Login
The Api.Login method checks the login data of the user and on successful verification opens a
new Web API session. The method requests the name and the password of the user in plain
text as proof of authorization. The user name and the password are encrypted before they are
transferred to the server.
Examples
The following examples show the parameters that are required or optional for calling the
Api.Login method.
{
"user": "User1",
"password": "1234"
}
Parameter "include_web_application_cookie":
{
"user": "User1",
"password": "SecurePassword",
"include_web_application_cookie": true
Web server
Function Manual, 11/2023, A5E03484625-AK 171
API (Application Programming Interface)
5.4 Web API basic functions
After successful authentication the user receives a token. The token identifies the user as
successfully authenticated.
In addition to the token, the Api.Login method optionally returns a cookie that is required to
access web applications:
{
"token": "eG9mcHdhaGR0dWVsdm5teGFxcGw=",
"web_application_cookie": "Cb5xdhgiokr0dWVsdm5teGCncFb="
}
The "web_application_cookie" cookie is set with a value from the HTTP response of the login
as "siemens_web_secure" cookie.
Token
The token comprises a 28-byte string. The token is transferred in encrypted form.
For every additional request which requires authentication, you have to specify the assigned
token in the HTTP request header. If further communication no longer takes place in the
meantime, the token becomes invalid after maximum 2.5 minutes. Each new request within
a session extends the validity of the token by another 2 to 2.5 minutes, calculated from the
completion of the request processing by the server.
The token is not required for methods that do not require authentication. However, you can
still enter the token. If the token is passed when a method is called, the timeout of the
corresponding session is reset.
When you call the Api.Ping method without a token, for example, the session is not extended
because the CPU cannot assign a token to the user.
The following methods work with and without tokens:
• Api.Browse
• Api.Ping
• Api.GetPermissions
Web server
172 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.4 Web API basic functions
NOTE
User "Everybody"/"Anonymous"
Note that, unlike TIA Portal, the API only accepts the English notation "Everybody" or
"Anonymous".
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-6 Api_Login_Response (object)
Name Required Data type Description
token Yes string The token indicates that its holder has successfully authenticated
themselves at the Web API.
The returned token must be passed via the HTTP request header
"X-Auth-Token" in subsequent Web API requests.
web_application No string Only present if "include_web_application_cookie" is "true".
_cookie The holder of the token has successfully authenticated them
selves with the Web API and has authorization to access protec
ted web applications.
password_expira No object of type This object contains information on the expiration of the pass
tion Api_Login_ word, if:
PasswordExpiration • The "local" authentication mode is used for the CPU and
_Response • The password policy is activated on the CPU
runtime_timeout No string If the "local" authentication mode is used for the CPU:
ISO 8601 time span as string
Time span of inactivity in seconds after which a client application
is to perform a logout using the API method Api.Logout.
Web server
Function Manual, 11/2023, A5E03484625-AK 173
API (Application Programming Interface)
5.4 Web API basic functions
Examples
Successful login for a user without expiration of the password (either static user
management or password expiration deactivated):
{
"token": "TXlMdWdnYWdlSGFzVGhlU2FtZSE="
}
Successful login for a user with password expiration:
{
"token": "TXlMdWdnYWdlSGFzVGhlU2FtZSE=",
"password_expiration":
[
"timestamp": "2023-11-05T18:25:43Z",
"warning": true
}
}
Successful login for a user with expiration of the password and runtime_timeout of 30
minutes:
{
"token": "TXlMdWdnYWdlSGFzVGhlU2FtZSE=",
"runtime_timeout": "PT30M",
"password_expiration":
[
"timestamp": "2023-11-05T18:25:43Z",
"warning": true
}
}
Web server
174 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.4 Web API basic functions
Example
You can find an example with further processing of the cookie "web_application_cookie" in
section Example: Web page for monitoring and controlling a wind turbine.
5.4.2 Api.GetPermissions
After the successful login, the Api.GetPermissions returns a list of actions for whose execution
the user is authorized.
Response structure
The following table shows the structure of server responses to successful requests:
Table 5-8 Api_GetPermissions_Response (array of objects)
Name Required Data type Description
Name Yes string Name of authorization
Example
The following example shows the actions for which the user is authorized.
[
{ "name": "read_value" },
{ "name": "change_operating_mode" }
]
Checkable authorizations
You can use the Web API to check the authorizations for the following functions.
Action User authorization As of the firmware
version of the CPU
flash_leds Identify device V2.8
acknowledge_alarms Acknowledge alarms V2.8
read_diagnostics Query diagnostics data from the CPU without being V2.8
permitted to change data.
read_value Read process data from the CPU. V2.8
write_value Write process data to the CPU. V2.8
open_user_pages Call user-defined pages on the CPU. V2.8
manage_user_pages Change user-defined pages on the CPU. V2.9
read_file* Read the contents of files on the CPU. V2.8
write_file* Change the contents of files and folders on the CPU. V2.8
change_operating_mode Change the operating mode. V2.8
backup_plc Back up the CPU configuration. V2.8
* Also available for the R/H-CPU of the redundant S7-1500R/H system (as of firmware version V3.1).
Web server
Function Manual, 11/2023, A5E03484625-AK 175
API (Application Programming Interface)
5.4 Web API basic functions
For projects with firmware version ≤ V3.0, the Web API checks the authorization based on the
rights and passwords assigned in STEP 7 in the Inspector window in the "Web server > User
management" area.
For projects with firmware version ≥ V3.1, the Web API checks the authorization based on the
rights and passwords assigned in STEP 7 in the project tree in the "Security settings > Users
and roles" area.
A description of the user management can be found in section "Configuring the Web server
(Page 26)".
5.4.3 Api.Browse
The Api.Browse method gives you a list of all methods that you can call via the Web API with
the current firmware. This provides you with an overview of all the methods supported by the
CPU.
No authorization is required for calling the Api.Browse method.
Example
The following example shows the HTTP request and a possible response to the request for the
Api.Browse method.
[{"jsonrpc":"2.0","method":"Api.Browse","id":1}]
[
{ "name": "Api.Browse" },
{ "name": "Api.GetCertificateUrl" },
{ "name": "Api.GetPermissions" },
Web server
176 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.4 Web API basic functions
{ "name": "Api.Login" },
{ "name": "Api.Logout" },
{ "name": "Api.Ping" },
{ "name": "Api.Version" },
{ "name": "PlcProgram.Browse" },
{ "name": "PlcProgram.Read" },
{ "name": "PlcProgram.Write" }
]
NOTE
Checking authorizations
The Api.Browse method does not filter the list of the available methods by the individual
authorizations of users.
The list of available methods may therefore contain methods which the user may not execute
without authorization.
5.4.4 Api.Version
Use the Api.Version method to request the current version number of the Web API. You can
draw conclusions from the version number:
• The functions supported by the CPU version
• The hardware functional status of the CPU
This information lets you implement applications that dynamically adapt to the scope of
functions offered by the contacted CPU. An application can support multiple CPU versions.
No authorization is required for calling the Api.Version method.
Example
The following example shows a possible result of calling the Api.Version method.
3.28
The version number is displayed as a floating-point number and is incremented with every
release and every change of the Web API.
Web server
Function Manual, 11/2023, A5E03484625-AK 177
API (Application Programming Interface)
5.4 Web API basic functions
5.4.5 Api.Ping
The Api.Ping method outputs a unique ID for the CPU used. You can use it to determine
whether the CPU can be reached. The CPU ID comprises a 28-byte string. The system assigns
a new, unique CPU ID after each restart (POWER ON - POWER OFF) or warm start of the CPU.
By comparing this with previously output IDs, you can also determine whether the CPU was
restarted in the meantime.
No authorization is required for calling the Api.Ping method.
Example
The following example shows the output of a CPU ID:
"ZWlmbnJwZmplb3Nwd2l1Y3N3dWE="
5.4.6 Api.GetCertificateUrl
The Api.GetCertificateUrl method returns a relative URL (https://<IP>) with which you can
retrieve the SSL certificate of the Web server.
Example
The following example shows the result of the Api.GetCertificateUrl method call.
"/MiniWebCA_Cer.crt"
The method outputs a string with a relative URL to the root directory of the CPU Web server
(https://[ip-address]).
If the Web server has not been configured with a CA certificate generated via the global
security settings, the method outputs an empty string.
5.4.7 Api.Logout
The Api.Logout method removes the token from the list of active Web API sessions and ends
the session.
The Api.Logout method returns the status of whether the logout was successful or not. For
security reasons, however, the method always returns the Boolean value "true" even if the
token is invalid.
Web server
178 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.4 Web API basic functions
5.4.8 Api.GetQuantityStructures
The Api.GetQuantityStructures method returns different structure information of the Web
server.
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-9 Api_GetQuantityStructures_Response (object)
Name Required Data type Description
webapi_max_http_request_b Yes number Maximum size of the HTTP request body of a Web API request in
ody_size bytes
webapi_max_parallel_reques Yes number Maximum number of parallel requests at the API end point
ts
webapi_max_parallel_user_s Yes number Maximum number of parallel user sessions that use the API end
essions point
Example
The following example shows the response with the read parameters of a CPU.
{
"webapi_http_request_body_size": 131072,
"webapi_parallel_requests": 4,
"webapi_parallel_user_sessions": 200
}
5.4.9 Api.ChangePassword
You can change the password for a user account with the Api.ChangePassword method.
Recommendation: Before changing a password, read the password policy from the CPU using
the Api.GetPasswordPolicy API method. If the new password does not conform to the
password policy of the CPU, a corresponding error message is returned.
No prior authorizations are required to call the Api.ChangePassword method, but you must
enter the current password for this call.
Web server
Function Manual, 11/2023, A5E03484625-AK 179
API (Application Programming Interface)
5.4 Web API basic functions
Example
In the following example, the password is changed for the user account "HappyUser".
{
"username": "HappyUser",
"password": "mycurrentpassword",
"new_password": "mynewpassword"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
180 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.4 Web API basic functions
5.4.10 Api.GetPasswordPolicy
Passwords must fulfill specific criteria to be secure. The Api.GetPasswordPolicy method
provides you with the password policy of the CPU. The password policy is a global setting in
the STEP 7 project and applies for all users of the Web server. The method does not contain
any information on the expiration of the password. Any user, including unauthenticated
users ("Anonymous"), can call this API method.
No authorization is required for calling the Api.GetPasswordPolicy method.
Response structure
The following table shows you the structure of server responses to successful requests.
Table 5-11 Api_GetPasswordPolicy_Response (object)
Name Required Data type Description
password_policy Yes object The object represents the current password policy of the CPU.
min_password_length Yes number The minimum length of the password in UTF-8 character encoding.
Value range: 8 to 255
max_password_length Yes number The maximum length of the password in UTF-8 character encoding.
min_digits Yes number The minimum number of numerals (0 to 9) within the password.
Value range: 0 to 255
min_special_characters Yes number The minimum number of special characters within the password.
Special characters are: !#$%&()*+,-./:;<=>?@[\]_{|}~^
Value range: 0 to 255
requires_uppercase_characte Yes bool The password contains at least one uppercase character A to Z.
rs Values: true or false
requires_lowercase_character Yes bool The password contains at least one lowercase character a to z.
s Values: true or false
Example
CPU project with a password policy
{
"password_policy":
{
"min_password_length": 8,
"max_password_length ": 120,
"min_digits": 2,
"min_special_characters": 1,
"requires_uppercase_characters": true,
"requires_lowercase_characters": true
}
}
Web server
Function Manual, 11/2023, A5E03484625-AK 181
API (Application Programming Interface)
5.4 Web API basic functions
5.4.11 Api.GetAuthenticationMode
You can read the current authentication mode of the CPU with the
Api.GetAuthenticationMode method.
No authorization is required for calling the Api.GetAuthenticationMode method.
Response structure
The following table shows you the structure of server responses to successful requests.
Table 5-13 Api_GetAuthenticationMode_Response (object)
Name Required Data type Description
authentication_mode Yes array of strings The parameter describes the current authentication mode sup
ported by the CPU.
Web server
182 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.5 Setting the Web server default page
Example
In the following example, the authentication mode "local" (local user management) is read by
the CPU.
{
"authentication_modes": ["local"]
}
5.5.1 WebServer.SetDefaultPage
Use the API method WebServer.SetDefaultPage to configure a web application as the default
page of the Web server.
You can only configure web applications as the start page, but not web pages or user-defined
pages of the CPU's Web server.
To call this method, you need "change_webserver_default_page" authorization.
Examples
In the following example, the default page named "index.html" for the web application
"webapp1" is used:
{
"default_page": "/~webapp1/index.html"
}
In the following example, the default page is set to "webapp1": In this case, you need to
configure the web application to reference the specific default page of the web application.
{
"default_page": "/~webapp1/"
}
Web server
Function Manual, 11/2023, A5E03484625-AK 183
API (Application Programming Interface)
5.5 Setting the Web server default page
In the following example, the value for the default page name is empty. In this case, the
system falls back to the default page as defined in the hardware configuration in the TIA
Portal.
{
"default_page": ""
}
Response structure
If successful, the method returns the Boolean value "true".
5.5.2 WebServer.ReadDefaultPage
You use the API method WebServer.ReadDefaultPage to read the default page set with
WebServer.SetDefaultPage.
Response structure
If successful, the response returns the following structure:
Table 5-15 Webserver_ReadDefaultPage_Response
Name Required Data type Description
default_page Yes string The default page currently configured during runtime.
The returned value does not take into account the configura
tion of the hardware configuration start page in the TIA
Portal.
Web server
184 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
Binary representation
The Web API presents the values of primitive data types as pure binary data ("raw"). The
binary data is formatted as a JSON array. Each element within an array represents a single
data byte.
Name of the data type Name of the data type Representation in the Web API
in the TIA Portal in Web API
Bool bool Boolean JSON value: true or false
Byte Byte JSON unsigned integer in a range from 0 to 255
USInt usint
Word word JSON unsigned integer in a range from 0 to 65 535
UInt uint
HW_ANY hw_any
HW_IOSYSTEM hw_iosystem
HW_DPMASTER hw_dpmaster
HW_DEVICE hw_device
HW_DPSLAVE hw_dpslave
HW_IO hw_io
HW_MODULE hw_module
HW_SUBMODULE hw_submodule
HW_HSC hw_hsc
HW_PWM hw_pwm
HW_PTO hw_pto
HW_INTERFACE hw_interface
HW_IEPORT hw_ieport
Web server
Function Manual, 11/2023, A5E03484625-AK 185
API (Application Programming Interface)
5.6 Reading and writing process data
Name of the data type Name of the data type Representation in the Web API
in the TIA Portal in Web API
CONN_ANY conn_any JSON unsigned integer in a range from 0 to 65 535
CONN_PRG conn_prg
CONN_OUC conn_ouc
PORT port
RTM rtm_id
PIP pip
DB_ANY db_any
DB_WWW db_www
DB_DYN db_dyn
DWord dword JSON unsigned integer in a range from 0 to 4 294 967 295
UDInt udint
AOM_IDENT aom_ident
EVENT_ANY event_any
EVENT_ATT event_att
EVENT_HWINT event_hwint
CONN_R_ID conn_r_id
LWord lword JSON string with a numerical representation of an unsigned integer based
on the number 10 in a range from 0 to 18 446 744 073 709 551 615
ULInt ulint
SInt sint JSON signed integer in a range from -128 to 127
Int int JSON signed integer in a range from -32 768 to 32 767
OB_ANY ob_any
OB_DELAY ob_delay
OB_TOD ob_tod
OB_CYCLIC ob_cyclic
OB_ATT ob_att
OB_PCYCLE ob_pcycle
OB_HWINT ob_hwint
OB_DIAG ob_diag
OB_TIMEERROR ob_timeerror
OB_STARTUP ob_startup
DInt dint JSON signed integer in a range from -2 147 483 648 to 2 147 483 647.
LInt lint JSON string with a numerical representation of an unsigned integer based
on the number 10 in a range from -9 223 372 036 854 775, 808 to
9 223 372 036 854 775 807
Real real JSON floating-point number
If the floating-point number is infinite or NaN (not-a-number), the Web API
LReal lreal
returns the value null when reading a tag of this type.
Character char JSON string with a single ASCII character in a valid range from 0 to 127
If a tag of this type is read with a value outside the valid range, the Web API
outputs the value null.
Web server
186 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
Name of the data type Name of the data type Representation in the Web API
in the TIA Portal in Web API
WChar wchar JSON string with a UTF-8 string that represents a single UCS-2 character in a
valid range from 0 to 55 295.
If a tag of this type is read with a value outside the valid range, the Web API
returns the value null.
String string JSON string with a UTF-8 string
If a tag of this type is read with a value outside the valid UTF-8 string (max.
length 254 characters), the Web API returns the value null.
WString wstring JSON string with a UTF-8 string that represents a USC-2 string in a valid
range from 0 to 55 295.
If a tag of this type is read with a value outside the valid range (max. length
254 characters), the Web API outputs the value null.
Date date JSON unsigned integer in a range from 0 to 65 535
This value represents the number of days since 01.01.1990.
Time_Of_Day time_of_day JSON unsigned integer in a range from 0 to 4 294 967 295
This value represents the number of milliseconds since the beginning of the
day.
LTime_Of_Day ltime_of_day JSON string with a numerical representation of an unsigned integer based
on the number 10 in a range from 0 to 18 446 744 073 709 551 615
This value represents the number of nanoseconds since the beginning of
the day.
Time time JSON signed integer in a range from -2 147 483 648 to 2 147 483 647)
This value represents the number of milliseconds since a user-defined point
in time.
LTime ltime JSON string with a numerical representation of an unsigned integer based
on the number 10 in a range from -9 223 372 036 854 775 808 to
9 223 372 036 854 775 807
This value represents the number of nanoseconds since a user-defined
point in time.
S5Time s5time JSON object with the keys basis and value:
• The basis value is a JSON Unsigned Integer with a value of either 10,
100, 1000, or 10 000.
The value basis represents the millisecond multiplier of the value value.
• The value value is a JSON unsigned integer in the range from 0 to 999.
The value basis multiplied by the value value gives the timer interval in
milliseconds.
Date_And_Time date_and_time JSON object with the keys year, month, date, hour, minute, second, and
day_of_week:
• year is a JSON unsigned integer with a value in the range from 1 990 to
2 089
• month is a JSON unsigned integer with a value in the range 1 to 12
• day is a JSON unsigned integer with a value in the range 1 to 31
• hour is a JSON unsigned integer with a value in the range 0 to 23
• minute is a JSON unsigned integer with a value in the range 0 to 59
• second is a JSON floating point number with a value in the range 0 to
60
• day_of_week is a JSON string with a value of either sun, mon, tue,
wed, thu, fri, or sat
LDT ldt JSON string with a numerical representation of an unsigned integer based
on the number 10 in a range from 0 to 18 446 744 073 709 551 615
This value represents the number of nanoseconds since 01.01.1970 mid
night (12:00:00.0 am).
Web server
Function Manual, 11/2023, A5E03484625-AK 187
API (Application Programming Interface)
5.6 Reading and writing process data
Name of the data type Name of the data type Representation in the Web API
in the TIA Portal in Web API
Struct struct Structured data type whose data structure can be determined using the
PlcProgram.Browse method.
IEC_COUNTER iec_counter
IEC_TIMER iec_timer
DTL dtl
IEC_LTIMER iec_ltimer
IEC_SCOUNTER iec_scounter
IEC_DCOUNTER iec_dcounter
IEC_LCOUNTER iec_lcounter
IEC_UCOUNTER iec_ucounter
IEC_USCOUNTER iec_uscounter
IEC_UDCOUNTER iec_udcounter
IEC_ULCOUNTER iec_ulcounter
ERROR_STRUCT error_struct
NREF nref
CREF cref
Arrays
Arrays are displayed as JSON objects. The key is a string with a numeric representation of the
index.
The following example shows the representation in the TIA Portal:
Web server
188 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
NOTE
F-blocks
Note that fail-safe blocks allow read access only. It is not possible to write tags into fail-safe
blocks.
Web server
Function Manual, 11/2023, A5E03484625-AK 189
API (Application Programming Interface)
5.6 Reading and writing process data
5.6.3 PlcProgram.Read
Use the PlcProgram.Read method to read a single variable from a CPU.
To call the PlcProgram.Read method, you need the "read_value" authorization.
Examples
In the following example, the user requests a global tag in the "simple" representation.
{
"var": "\"MotorSpeed\""
}
In the following example, the user requests a data block tag in the "raw" representation.
{
"var": "\"MyDB\".MyVariable",
"mode": "raw"
}
Response structure
If the request to the server was successful, the server returns JSON data values.
Examples
The following example shows the result of reading in a tag of type "int" in the "simple"
representation.
-42
The following example shows the result of reading in a tag of type "dword" in the "raw"
representation.
Web server
190 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
[ 1, 47, 233, 0 ]
NOTE
Tag access with the methods PlcProgram.Read, PlcProgram.Write, and
PlcProgram.Browse
With these methods it is not yet possible to access all tags in firmware version V3.0.
There are selective restrictions when reading tags of technology objects. If access to specific
tags is not possible, the API returns the message "unsupported".
Web server
Function Manual, 11/2023, A5E03484625-AK 191
API (Application Programming Interface)
5.6 Reading and writing process data
5.6.4 PlcProgram.Write
Use the PlcProgram.Write method to write a single process tag to the CPU.
To call the PlcProgram.Write method, you need the "write_value" authorization.
Examples
In the following example, the user writes a global tag in the "simple" display.
{
"var": "\"MotorSpeed\"",
"value": 9001
}
In the following example, the user writes a tag to a data block in the "raw" representation.
{
"var": "\"MyDB\".MyVariable",
"value": [ 255, 77, 1, 99 ],
"mode": "raw"
}
In the following example, the user writes a string tag consisting of 10 characters to the
"simple" representation:
{
"var": "\"MyDB\".MyString",
"value": "Short Str",
"mode": "simple"
}
Web server
192 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
In the following example, the user writes a string tag consisting of 10 characters with the text
"Short Str" in the "raw" representation:
{
"var": "\"MyDB\".MyString",
"value": [ 10, 9, 83, 104, 111, 114, 116, 32, 83, 116, 114, 0 ],
"mode": "raw"
}
In the following example, the user writes a Wstring tag consisting of 6 characters in the
"simple" representation:
{
"var": "\"MyDB\".MyWString",
"value": "Hello",
"mode": "simple"
}
In the following example, the user writes a string tag consisting of 6 characters with the text
"Hello" in the representation "raw":
{
"var": "\"MyDB\".MyWString",
"value": [ 0, 6, 0, 5, 0, 72, 0, 101, 0, 108, 0, 108, 0, 111, 0, 0
],
"mode": "raw"
}
Response structure
If the write operation was successful, the server returns the Boolean value "true".
Web server
Function Manual, 11/2023, A5E03484625-AK 193
API (Application Programming Interface)
5.6 Reading and writing process data
NOTE
Tag access with the methods PlcProgram.Read, PlcProgram.Write, and
PlcProgram.Browse
With these methods it is not yet possible to access all tags in firmware version V3.0.
There are selective restrictions when reading tags of technology objects. If access to specific
tags is not possible, the API returns the message "unsupported".
5.6.5 PlcProgram.DownloadProfilingData
The PlcProgram.DownloadProfilingData method supplies you with detailed runtime data for
the user program in the CPU. The API method returns a ticket that you use to download
the runtime data from the CPU. You can evaluate and graphically display the information later
in order to analyze the program flow.
This information assists you in the following tasks:
• Runtime optimization of the user program
• Error diagnostics
• Evaluating the power reserve of the automation system
• Quality assurance of the application
To call the API method PlcProgram.DownloadProfilingData, you need "read_value"
authorization.
Response structure
If successful, the method returns a string with a ticket ID. You can use this ticket ID to
download the runtime data from the CPU.
You can find more information about the ticket mechanism in the section Ticket mechanism
(Page 164).
Example
The following example shows a generated ticket ID for downloading the runtime data.
"NDU2Nzg5MDEyMzQ1Njc4OTAxMjM0"
Web server
194 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
File name
The file name for downloading the runtime data to a web browser is structured as follows:
[project_name]_[module_name]_YYYY-MM-DD_HH-mm-ss_profiling.bin
Example: [1500_example01]_[plc_1]_2023-11-03_12-20-05_profiling.bin
The file name is returned as an HTTP Content-Disposition header in the server response.
The following table explains the meaning of the possible block types:
Web server
Function Manual, 11/2023, A5E03484625-AK 195
API (Application Programming Interface)
5.6 Reading and writing process data
Web server
196 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
The following table provides an example for read process image partition:
The following table explains the meaning of the possible entry types for direct I/O access:
Web server
Function Manual, 11/2023, A5E03484625-AK 197
API (Application Programming Interface)
5.6 Reading and writing process data
Web server
198 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
Web server
Function Manual, 11/2023, A5E03484625-AK 199
API (Application Programming Interface)
5.6 Reading and writing process data
5.6.6 PlcProgram.Browse
The PlcProgram.Browse method allows you to search for tags and the corresponding
metadata according to your individual requirements.
To call the PlcProgram.Browse method, you need the "read_value" authorization.
Example 1
In the following example the user searches the root node ("root") of the CPU.
{
"mode": "children"
}
[
{
"name": "TestDB",
"has_children": true,
"db_number": 2,
"datatype": "datablock"
},
{
"name": "GenUsrMsg_Ret",
"address": "%MW43",
Web server
200 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
"area": "M",
"datatype": "int"
}
]
Example 2
In the following example, the user searches the descendants (children) of a data block.
{
"var": "\"MyDB\"",
"mode": "children"
}
[
{
"name": "Static_1",
"db_number": 1,
"datatype": "int"
},
{
"name": "Static_2",
"db_number": 1,
"datatype": "int"
}
]
Example 3
In the following example, the user requests information about a specific tag.
{
"var": "\"MyDB\".MyStruct.MyField",
"mode": "var"
}
[
{
"name": "MyDateTimeValue",
"db_number": 2,
"datatype": "date_and_time",
Web server
Function Manual, 11/2023, A5E03484625-AK 201
API (Application Programming Interface)
5.6 Reading and writing process data
"array_dimensions": [
{
"start_index": 0,
"count": 3
}
]
}
]
Example 4
In the following example, the user searches code blocks of a CPU.
{
"mode": "children",
"type": ["code_blocks"]
}
[
{
"name": "MainOB",
"block_number": 1,
"block_type": "ob"
},
{
"name": "MotorControlConveyor",
"block_number": 23,
"block_type": "fb"
}
{
"name": "CREATE_DB",
"block_number": 86,
"block_type": "sfc",
}
{
…
}
]
Web server
202 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
Example 5
In the following example, the user searches the data blocks of a CPU.
{
"mode": "children",
"type": ["data_blocks"]
}
[
{
"name": "TestDB",
"block_number": 2,
"datatype": "datablock"
},
{
"name": "MotorControlConveyorDB",
"block_number": 23,
"datatype": "datablock"
}
]
Example 6
The following example shows the result of searching the root node "root" of the CPU when
the "type" parameter and all 3 possible array entries "data_blocks", "code_blocks" and "tags"
are selected:
{
"mode": "children",
"type": ["data_blocks, "code_blocks", "tags"]
}
[
{
"name": "TestDB",
"has_children": true,
"db_number": 2,
"datatype": "datablock"
},
{
"name": "GenUsrMsg_Ret",
Web server
Function Manual, 11/2023, A5E03484625-AK 203
API (Application Programming Interface)
5.6 Reading and writing process data
"address": "%MW43",
"area": "M",
"datatype": "int",
}
{
"name": "MainOB",
"block_number": 1,
"block_type": "ob"
}
]
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-32 PlcProgram_Browse_Response (array of objects)
Name Required Data type Description
name Yes string Tag name; can be used as a string identifier for the field.
address No string Address of the tag in STEP 7; only applicable for the tags in the
ranges M, I, Q, timer and counter and tags in non-optimized data
blocks.
The representation corresponds to the addresses in the watch
tables in the TIA Portal.
read_only No bool Query whether the tag is read-only.
The only valid value is "true".
If the tag is to be written, this attribute does not appear.
has_children No bool Query whether the tag is a structured tag with child tags.
The only valid value is "true".
If the tags are an unstructured data type, this attribute is not dis
played.
db_number No number Numerical data block identifier;
appears when "datatype" = "datablock" and for each child element
of a data block (with corresponding data block number).
area No string Letter which defines the range (M/I/Q/timer/counter) of the tag.
If the tag is not in one of these ranges, the attribute does not
appear.
datatype Yes string Data type of the tag
For data blocks, this is the "datablock" data type; for tags, see the
table in the section Supported data types (Page 185).
If the data type is not supported, the data type is "unsupported".
max_length No number If the data type is a "string" or "wstring", this value is the maxim
um number of characters allowed in the tag.
array_dimensions No PlcProgram_Browse_ Object arrays arranged from the most significant to the least sig
Response_ArrayData nificant array dimension.
The attribute is only displayed if the tag is an array.
block_number No number Number of the logic block
Web server
204 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.6 Reading and writing process data
NOTE
Tag access with the methods PlcProgram.Read, PlcProgram.Write, and
PlcProgram.Browse
It is not yet possible to access all tags with these methods in firmware version ≥ V3.0.
There are selective restrictions when reading tags of technology objects. If access to specific
tags is not possible, the API returns the message "unsupported".
Web server
Function Manual, 11/2023, A5E03484625-AK 205
API (Application Programming Interface)
5.7 Reading and changing the operating mode
5.7.1 Plc.ReadOperatingMode
With the Plc.ReadOperatingMode method you can read the operating mode of the CPU.
To call the Plc.ReadOperatingMode method, you need the "read_diagnostics" authorization.
Response structure
If the request to the server was successful, the server returns the operating mode as a string.
The following strings are possible for operating modes:
5.7.2 Plc.RequestChangeOperatingMode
With the Plc.RequestChangeOperatingMode method, you request a new operating mode for
the CPU.
Note that this is only a request for an operating mode. The conditions for an operating mode
change must be given at the CPU, e.g. by the corresponding position of the mode selector.
You can use the Plc.ReadOperatingMode (Page 206) method to check whether the operating
mode change on the CPU was successful.
To call the Plc.RequestChangeOperatingMode method, you need the
"change_operating_mode" authorization.
Web server
206 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.7 Reading and changing the operating mode
Example
In the following example, the RUN mode is requested.
{
"mode": "run"
}
Response structure
If the request to the server was successful, the server returns the Boolean value "true".
5.7.3 Plc.ReadModeSelectorState
The Plc.ReadModeSelectorState method reads the current position of the mode switch to the
CPU.
To call the Plc.ReadModeSelectorState method, you need "read_diagnostics" authorization.
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-35 Plc_ReadModeSelectorState_Response (object)
Name Required Data type Description
redundancy_id Yes for R/H-CPUs number The parameter redundancy ID must be available if the request is
No for all other performed on an R/H-CPU. The redundancy ID has the value 1 or
CPUs 2.
For all other CPUs, the parameter does not have to be part of the
request.
mode_selector Yes string Possible values:
• "run"
• "stop"
• "no_switch"
• "unknown"
Example
In the following example, RUN mode is read.
{
"mode_selector": "run"
}
Web server
Function Manual, 11/2023, A5E03484625-AK 207
API (Application Programming Interface)
5.8 Change time settings via Web API
5.8.1 Plc.ReadSystemTime
This API method provides the system time of the CPU. If you have synchronized the system
time of the CPU, for example via the TIA Portal function "Online & diagnostics", the system
time corresponds to Coordinated Universal Time (UCT).
Response structure
The following table shows you the structure of server responses to successful requests.
Table 5-36 Plc_ReadSystemTime_Response (object)
Name Required Data type Description
timestamp Yes string ISO8601 time stamp as string in nanoseconds
Example
The following example shows the structure of the time stamp.
{
"timestamp": "2012-04-23T18:25:43.123456789Z"
}
Web server
208 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.8 Change time settings via Web API
5.8.2 Plc.SetSystemTime
Use this API method to set the system time of the CPU (PLC local time).
To call the Plc.SetSystemTime method, you need the "change_time_settings" permission.
Example
The following example shows the structure of the time stamp.
{
"timestamp": "2023-11-05T18:25:43.515154511Z"
}
Response structure
The server always returns the Boolean value "true" for successful requests.
Web server
Function Manual, 11/2023, A5E03484625-AK 209
API (Application Programming Interface)
5.8 Change time settings via Web API
5.8.3 Plc.ReadTimeSettings
This API method returns the currently active time, the deviation of the time zone from
Coordinated Universal Time (UCT), and any daylight saving time rules.
Web server
210 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.8 Change time settings via Web API
Example 1
A daylight saving time rule is configured in the following example.
{
"current_offset": "PT1H",
"utc_offset": "PT2H",
"rule":
{
"dst":
{
"offset": "PT1H",
"start":
{
"month": 4,
"week": 4,
"day_of_week": "sun",
"hour": 3,
"minute": 0
}
},
"std":
{
Web server
Function Manual, 11/2023, A5E03484625-AK 211
API (Application Programming Interface)
5.8 Change time settings via Web API
"start":
{
"month": 10,
"week": 5,
"day_of_week": "sun",
"hour": 2,
"minute": 0
}
}
}
}
Example 2
In the following example, no daylight saving time rule has been configured and a time offset
of 1 hour exists.
{
"current_offset": "PT1H",
"utc_offset": "PT2H",
}
5.8.4 Plc.SetTimeSettings
With this API method you can set the time settings of the CPU.
To call the Plc.SetTimeSettings method, you need the "change_time_settings" permission.
Web server
212 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.8 Change time settings via Web API
Web server
Function Manual, 11/2023, A5E03484625-AK 213
API (Application Programming Interface)
5.8 Change time settings via Web API
Example 1
The following example shows how to set a rule with daylight saving time parameters.
{
"utc_offset": "PT2H",
"rule":
{
"dst":
{
"offset": "PT1H",
"start":
{
"month": 4,
"week": 4,
"day_of_week": "wed",
"hour": 3,
"minute": 0
}
},
"std":
{
"start":
{
"month": 10,
"week": 5,
"day_of_week": "wed",
"hour": 2,
"minute": 0
}
}
}
}
Example 2
The following example shows the setting of a rule without daylight saving time parameters.
{
"utc_offset": "PT6H",
}
Response structure
If successful, the method returns the Boolean value "true".
Web server
214 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.9 Reading diagnostics and service data
5.9.1 Project.ReadLanguages
This API method returns a list with the project languages available on the CPU.
You can then use the "Alarms.Browse" or "DiagnosticBuffer.Browse" API methods in one of the
available languages to get alarm messages or diagnostic messages in the available languages.
To call the Project.ReadLanguages method, you need the "read_diagnostics" permission.
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-48 Project_ReadLanguages_Response (Array of objects)
Name Required Data type Description
languages Yes array of Object array, where each object represents a
Project_ReadLanguages_Entry_Response project language.
Web server
Function Manual, 11/2023, A5E03484625-AK 215
API (Application Programming Interface)
5.9 Reading diagnostics and service data
Example
The following example shows the output of a project language as a string.
{
"languages":
[
{
"language": "en-US"
}
]
}
NOTE
No project language configured
If no project language was configured, the object array is empty.
5.9.2 Alarms.Browse
With this method you can determine which alarms are currently active on the CPU, and when
the last change occurred within the diagnostics buffer.
To call the Alarms.Browse method, you need the "read_diagnostics" permission.
Web server
216 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.9 Reading diagnostics and service data
Examples
The following example shows a request for reading a single alarm with all alarm areas in the
English language:
{
"language": "en-US",
"alarm_id": "1231231231"
}
The following example shows the request for reading a single alarm without the alarm areas
excluded under "exclude":
{
"language": "en-US",
"alarm_id": "1231231231",
"filters":
{
"mode": "exclude",
"attributes": ["alarm_text", "info_text"],
}
}
The following example shows the request for reading 50 alarms with the alarm ranges
included in "include".
{
"language": "en-US",
"count": 50,
"filters":
Web server
Function Manual, 11/2023, A5E03484625-AK 217
API (Application Programming Interface)
5.9 Reading diagnostics and service data
{
"mode": "include",
"attributes": ["status", "acknowledgement"]
}
}
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-52 Alarms_Browse_Response (object)
Name Required Data type Description
language No, optional and string The language of the response in which the message text is out
only available put.
when entries are If no valid language was requested, the server outputs the mes
returned; not rel sage "invalid".
evant if, for
example,
count = 0 is
requested
last_modified Yes string ISO 8601 time stamp in UTC as string;
The time stamp with the last change of the alarm system since
you made the last read request.
The time stamp allows you to see when the last alarm change
occurred in the system without having to check individual alarms
in detail.
count_current Yes number The number of active alarms.
count_max Yes number The maximum number of active alarms.
entries No array of objects of The list of pending alarms, where each alarm entry is represented
Alarm_Browse_Entr as an object.
y_response
Web server
218 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.9 Reading diagnostics and service data
Examples
The following example shows the response to a request with a non-acknowledged alarm and
all attributes (no filters set).
{
"entries":
[
{
"id": "121651651651",
"timestamp": "2023-11-05T18:25:43.511987654Z",
"status": "incoming",
"alarm_number": 37,
"producer": "system_diagnostics",
"hwid": 49,
"acknowledgement":
{
"state": "not_acknowledged"
},
Web server
Function Manual, 11/2023, A5E03484625-AK 219
API (Application Programming Interface)
5.9 Reading diagnostics and service data
The following example shows the response to a request with an acknowledged alarm and all
attributes (no filters set):
{
"entries":
[
{
"id": "121651651651",
"timestamp": "2023-11-05T18:25:43.511987654Z",
"status": "incoming",
"alarm_number": 35,
"producer": "system_diagnostics",
"hwid": 49,
"acknowledgement":
{
"state": "acknowledged",
"timestamp": "2023-11-05T18:25:50.123456789Z"
},
"alarm_text": "CPU status message: CPU not in RUN Current CPU
operating mode: STOP",
"info_text": "Short name: CPU general Order number: 6ES7
516-3AP03-0AB0",
"text_inconsistent": false
}
],
"last_modified": "2023-11-05T18:25:43.511546151Z",
"count_current": 1,
"count_max": 5000,
"language": "en-US"
}
The following example shows the filtered response to a query with only alarm IDs:
Web server
220 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.9 Reading diagnostics and service data
{
"entries":
[
{
"id": "121651651651",
"producer": "system_diagnostics"
}
{
"id": "121651651652"
"producer": "system_diagnostics",
}
{
"id": "121651651653"
"producer": "program_alarm",
}
],
"last_modified": "2023-11-05T18:25:43.511546151Z",
"count_current": 3,
"count_max": 5000,
"language": "en-US"
}
5.9.3 Alarms.Acknowledge
Use this method to acknowledge individual alarms.
To call the Alarms.Acknowledge method, you need the "acknowledge_alarms" permission.
Web server
Function Manual, 11/2023, A5E03484625-AK 221
API (Application Programming Interface)
5.9 Reading diagnostics and service data
Examples
The following example shows the ID of an alarm to be acknowledged:
{
"id": "9979413824317259784"
}
Response structure
If successful, the method returns the Boolean value "true".
5.9.4 Syslog.Browse
The Syslog.Browse method reads the entries of the CPU's internal syslog buffer.
To call the Syslog.Browse method, you need "read_syslog" authorization.
Web server
222 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.9 Reading diagnostics and service data
Example 1
In the following example, the user requests up to 20 syslog entries, beginning with the latest
entries.
{
"count": 20
}
Example 2
In the following example, the user requests up to 20 syslog entries, beginning with entry
853.
{
"count": 20,
"first": 853
}
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-56 Syslog_Browse_Response (object)
Name Required Data type Description
entries Yes array of Contains an array of objects where each object is a single syslog
Syslog_Browse_ entry of the
Entry_Request CPU's internal syslog buffer.
count_total Yes number This attribute contains the overall number of the entries in the
syslog buffer since startup of the CPU.
count_lost Yes number This attribute contains the number of entries of the syslog buffer
which were lost.
This is the number of the entries which were not overwritten
through new entries and not
stored on the syslog server.
Web server
Function Manual, 11/2023, A5E03484625-AK 223
API (Application Programming Interface)
5.9 Reading diagnostics and service data
Example 1
In the following example, an individual syslog entry is returned.
{
"entries":
[
{
"<35>1 2023-08-24T22:22:50.468Z 192.168.0.1 Webserver - ID6
[device@4329.6.100.1.1500 devVendor="Siemens" devProduct="CPU1500
(PLCSIM)"
FWVersion="T31.16.20"][session@4329.6.100.1.1500 protocolType="HTTPS
" userName="Anonymous" src="192.168.0.99"
sessionID="1"][function@4329.6.100.1.1500 fct="login"
result="success"] SE_DEFAULT_USER_AUTHENTICATION_USED"
}
],
"count_total": 546875456,
"count_lost": 0
}
Example 2
In the following example, an empty syslog response is returned, if previously no syslog
message was available in the syslog buffer.
{
"entries": [],
"count_total": 0,
"count_lost": 0
}
Example 3
In the following example, an empty syslog response is returned, if count = 0 is requested.
This query can be used to request the ID of the last syslog entry without data to detect if new
entries are available.
{
"entries": [],
"count_total": 546875456,
"count_lost": 0
}
Web server
224 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.9 Reading diagnostics and service data
5.9.5 DiagnosticBuffer.Browse
With this method you read out entries from the diagnostics buffer of the CPU.
To call the DiagnosticBuffer.Browse method, you need the "read_diagnostics" permission.
Web server
Function Manual, 11/2023, A5E03484625-AK 225
API (Application Programming Interface)
5.9 Reading diagnostics and service data
Example
The following example shows a request of the diagnostic entries as LCID value 1033 (dec
value), which stands for "English – United States".
{
"language": "en-US",
"count": 50,
"entries":
{
"mode": "include",
"attributes": ["short_text", "long_text", "help_text"]
}
}
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-60 DiagnosticBuffer_Browse_Response (object)
Name Required Data type Description
entries No array of objects of Array of diagnostics buffer entries, where each object represents
DiagnosticBuffer_Br one diagnostics buffer entry.
owse_Entry_Respon
se
last_modified Yes string ISO 8601 time stamp as a string; time stamp of the last change in
the diagnostics buffer.
count_current Yes number Number of available diagnostics buffer entries.
count_max Yes number Maximum number of possible diagnostics buffer entries
language No, optional and string The language in which the response is output.
only available
when entries are
returned; not rel
evant if, for
example,
count = 0 is
requested
Web server
226 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.9 Reading diagnostics and service data
Example
The following example shows the representation of a single entry in the diagnostics buffer
(system diagnostics message).
{
"entries":
[
{
"timestamp": "2023-11-05T18:25:43.511854547Z",
"status": "outgoing",
"long_text": "CPU info: Boot up
memory card type: Program card (external load memory)
CPU changes from OFF to STOP (initialization) mode
PLC_2 / PLC_2",
"short_text": "Boot up - CPU changes from OFF to STOP
(initialization) mode",
"help_text": "",
"event"
{
"textlist_id": 2,
"text_id": 16385
}
}
],
"last_modified": "2023-11-05T18:25:43.514678521Z",
"count_current": 1234,
"count_max": 3200,
"language": "en-US"
}
Web server
Function Manual, 11/2023, A5E03484625-AK 227
API (Application Programming Interface)
5.9 Reading diagnostics and service data
5.9.6 Modules.DownloadServiceData
The API method Modules.DownloadServiceData returns a ticket that you use to download
service data from the CPU. You can then forward the service data to Customer Support, for
example for an analysis of your production data in the event of an error.
To call the API method Modules.DownloadServiceData, you need "download_service_data"
authorization.
You can find more information about the ticket mechanism in the section Ticket mechanism
(Page 164).
Response structure
If successful, the method returns a string with a ticket ID. Use this ticket ID to download the
service data.
NOTE
A maximum of only one Modules.DownloadServiceData ticket can be created for all users. A
new ticket can be created for this method only after this ticket has been closed.
Example
The following example shows a generated ticket ID for service data download.
"NDU2Nzg5MDEyMzQ1Njc4OTAxMjM0"
Web server
228 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.10 Backing up and restoring the configuration
5.10.1 Plc.CreateBackup
With this API method, you request a ticket to create a backup file of the CPU configuration.
To call the Plc.CreateBackup method, you need the "backup_plc" permission.
Response structure
The method returns a string with a ticket ID for creating a backup file.
Example
The following example shows a generated ticket ID for creating a backup file.
"NDU2Nzg5MDEyMzQ1Njc4OTAxMjM0"
An example of further processing of the ticket ID can be found in the Ticket mechanism (Page
164) section.
Web server
Function Manual, 11/2023, A5E03484625-AK 229
API (Application Programming Interface)
5.10 Backing up and restoring the configuration
Web server
230 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.10 Backing up and restoring the configuration
5.10.2 Plc.RestoreBackup
Use this API method to request a ticket that restores the configuration of a CPU via a backup
file.
To call the Plc.RestoreBackup method, you need the "restore_plc" permission.
Example
The following example shows how to enter a password.
{
"password": "SecurePassword"
}
Response structure
The method returns a string. The string contains a ticket ID that you can use to restore the
configuration on a backup file.
Example
The following example shows a generated ticket ID for restoring the configuration of a CPU.
"NDU2Nzg5MDEyMzQ1Njc4OTAxMjM0"
An example of further processing of the ticket ID can be found in the Ticket mechanism (Page
164) section.
Web server
Function Manual, 11/2023, A5E03484625-AK 231
API (Application Programming Interface)
5.10 Backing up and restoring the configuration
NOTE
Tracking the recovery process via Api.BrowseTickets
The Api.BrowseTickets method provides information about the current status of the recovery.
Use this method to found out the recovery process phase, and whether the recovery process
was successful.
Status Description
waiting The waiting state is active until the upload of the backup file is
started.
ongoing As soon as the upload of the backup file has started, the state
changes to ongoing.
Web server
232 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.10 Backing up and restoring the configuration
Status Description
rebooting_format The CPU is restarting.
The reason for the restart is the formatting of the SIMATIC
Memory Card.
rebooting The CPU is restarting.
The reason for the restart is the activation of the restored
project.
failed An error occurred during the upload of the backup file.
You can abort the upload when an error occurs.
failed_failsafe An error occurred during the execution of the fail-safe func
tion.
Ensure that the password passed to the Plc.RestoreBackup
method is correct and the user has the F-Admin function right.
failed_wrong_interface You have started the upload of the backup file to the CPU via a
CM or CP interface.
NOTE
Loss of the configuration during the restoration process
Note that the CPU loses the configuration during the restoration process.
4. Before restarting the CPU, it is possible to read the status with the Api.BrowseTickets(id)
method. The additional information informs you about restarting the CPU and formatting
the SIMATIC Memory Card as next steps.
To be informed about the process and all messages, we recommend that you read the
information of the Api.BrowseTickets method cyclically, e.g. every second.
5. The CPU then restarts and formats the SIMATIC Memory Card.
During the restart you can use the Api.Ping method to determine when the CPU is
available again.
During the restart, the Api.BrowseTickets and Api.Ping methods do not respond.
6. The CPU puts the web server into a state with reduced functionality. Only a limited
number of API methods is available to you during this time.
NOTE
If you want to restore the CPU to its normal state during the restoration process, perform
a download via the TIA Portal. After the download, the CPU and the web server are again
in normal operation and all functions are available for use.
7. Use the Api.Login method to log on with the logon data that were also valid at the
beginning of the restoration process.
8. Request a ticket for the restore using the Plc.RestoreBackup method.
9. Upload the backup file via the ticket end point.
After successful upload, the CPU restarts after 3 seconds.
10. Before restarting the CPU, it is possible to read the status with the Api.BrowseTickets(id)
method. The additional information informs you about the restart and about the
successful upload.
The restart is required to activate the new project.
Web server
Function Manual, 11/2023, A5E03484625-AK 233
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
11. During the restart you can use the Api.Ping method to determine when the CPU is
available again.
12. As soon as the CPU is available again, the restoration process is completed and the
recovered project is loaded into the CPU.
You can now log in with the credentials of a user of the project loaded into the CPU, if
desired.
Further work in the API requires a new login with the Api.Login method.
NOTE
Access to the file system for R/H-CPUs
The file API only offers limited access to the SIMATIC Memory Card. Access is restricted to the
"UserFiles", "DataLogs", and "Recipes" folders. Other content on the SIMATIC Smart Card is not
accessible via the API.
5.11.1 Files.Browse
This method returns a list of the contents of subdirectories and attributes of specific
directories or files which are located on the SIMATIC Memory Card of a CPU.
To call the Files.Browse method, you need the "read_file" permission.
NOTE
For R/H-CPUs, only a maximum of three folders – Recipes, UserFiles and DataLogs – are
returned in the root directory of the SIMATIC memory card. No other folders are returned.
Web server
234 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
Example
The following example shows a request specifying the desired path to a txt file:
{
"resource": "/myfolder/file.txt"
}
The following example shows a request specifying the desired path to a csv file (datalog).
{
"resource": "/Datalogs/datalog1.csv"
}
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-65 Communication_ReadStatistics_Response (object)
Name Required Data type Description
resources yes array of Resource list.
files_Browse_Entry_Response
Example
The following example shows the response to a request with a file and a folder:
{
"resources":
[
{
"name": "my_dir",
"type": "dir",
"last_modified": "2012-04-23T18:25:43Z"
},
{
Web server
Function Manual, 11/2023, A5E03484625-AK 235
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
"name": "my_file.txt",
"type": "file",
"size": 87654567,
"last_modified": "2012-04-23T18:25:43Z"
}
]
}
The following example shows the response to a query with an active csv file:
{
"resources":
[
{
"name": "datalog1.csv",
"type": "file",
"size": 87654567,
"last_modified": "2012-04-23T18:25:43Z",
"state": "active"
}
]
}
Web server
236 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
5.11.2 Files.Download
This method creates a ticket that you can use to download a file from the CPU.
To call the Files.Download method, you need the "read_file" permission.
For more information about the ticket mechanism, see the Ticket mechanism (Page 164)
section.
Examples
The following example shows a request specifying the path to a txt file:
{
"resource": "/myfolder/file.txt"
}
The following example shows a request specifying the path to a csv file (datalog):
{
"resource": "/Datalogs/datalog1.csv"
}
Response structure
If successful, the method returns a string with a ticket ID.
Example
The following example shows a generated ticket ID for downloading the file:
"NDU2Nzg5MDEyMzQ1Njc4OTAxMjM0"
NOTE
Ticket-based file downloads
For all ticket-based file downloads, the ticket returns a file name in the HTTP content
disposition header. You can use this file name as the default file name, or as the name used
by the web browser as the default name.
Web server
Function Manual, 11/2023, A5E03484625-AK 237
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
5.11.3 Files.Create
This method creates a ticket that you use to upload a file to the CPU.
To call the Files.Create method, you need the "write_file" permission.
For more information about the ticket mechanism, see the Ticket mechanism (Page 164)
section.
NOTE
Uploading a file on R/H-CPUs
If a file is uploaded during SYNCUP, the R/H system aborts the upload of this file. During
SYNCUP, the R/H does not wait until the file has uploaded.
NOTE
Storage location of files on R/H-CPUs
Files can only be created in the Recipes and UserFiles folders and not in the root directory or
outside these two folders.
Web server
238 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
Example
The following example shows a request specifying the path to the desired file:
{
"resource": "/mydir/file.txt"
}
Response structure
If successful, the method returns a string with a ticket ID.
Example
The following example shows a generated ticket ID for uploading the file:
"NDU2Nzg5MDEyMzQ1Njc4OTAxMjM0"
Web server
Function Manual, 11/2023, A5E03484625-AK 239
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
5.11.4 Files.Rename
This method changes the name of a file or directory. You can also use this method to move
files from one directory to another.
To call the Files.Rename method, you need the "write_file" permission.
NOTE
Note that you cannot use this method for the "DataLogs" folder.
Example
The following example shows a change of the file name.
{
"resource": "/folder/old_file_name.txt",
"new_resource": "/folder/new_file_name.txt"
}
Response structure
If successful, the method returns the Boolean value "true".
Web server
240 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
5.11.5 Files.Delete
This method deletes files from the CPU.
To call the Files.Delete method, you need the "write_file" permission.
NOTE
Deleting DataLog files
You can also delete DataLog files with this method, but only if the file is not currently in use.
If the DataLog file is currently in use, error message 303 appears: Entity in use.
NOTE
Deleting inactive DataLog files
If you have created a ticket for DataLogs.DownloadAndClear or Files.Download on an inactive
DataLog file, you can still use the Files.Delete method to delete this file.
As a result, a download that has already been started or will be started in the future will fail
with these tickets.
Web server
Function Manual, 11/2023, A5E03484625-AK 241
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
Example
The following example shows a request specifying the path to a txt file:
{
"resource": "/myfolder/file.txt"
}
The following example shows a request specifying the path to a csv file (datalog).
{
"resource": "/Datalogs/datalog1.csv"
}
Response structure
If successful, the method returns the Boolean value "true".
Web server
242 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
5.11.6 Files.CreateDirectory
This method creates a new directory on the CPU.
To call the Files.CreateDirectory method, you need the "write_file" permission.
NOTE
Available folders for R/H-CPUs
You can only create the DataLogs, Recipes and UserFiles folders. The folders are created on
the system with the corresponding spelling UserFiles, Recipes, DataLogs, regardless of
whether you specify resource="/datalogs", for example.
Example
The following example shows a request specifying the path to the desired directory:
{
"resource": "/SPH_Storage/OPCUA"
}
Response structure
If successful, the method returns the Boolean value "true".
Web server
Function Manual, 11/2023, A5E03484625-AK 243
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
5.11.7 Files.DeleteDirectory
This method deletes an existing directory from the CPU.
To call the Files.DeleteDirectory method, you need the "write_file" permission.
NOTE
Recursive deletion
Note that recursive deletion is not possible, and that the directory must be empty before you
can delete it.
Example
The following example shows a request specifying the path to the desired directory:
{
"resource": "/SPH_Storage"
}
Response structure
If successful, the method returns the Boolean value "true".
Web server
244 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
5.11.8 DataLogs.DownloadAndClear
The DataLogs.DownloadAndClear method creates a ticket to download DataLogs from the
CPU and delete them after processing.
NOTE
If you do not want to delete the contents of DataLogs after downloading, use the
Files.Download method instead.
For more information about this method, see the Files.Download (Page 237) section.
NOTE
You can apply the DataLogs.DownloadAndClear method only if the DataLog is not currently in
use. If the DataLog is currently in use, the error message 303: Entity in use appears.
Web server
Function Manual, 11/2023, A5E03484625-AK 245
API (Application Programming Interface)
5.11 Accessing the contents of the SIMATIC Memory Card
Examples
The following example shows a request specifying the name of the desired DataLog.
{
"resource": "datalog1"
}
The following example shows a request with specification of the path to the desired DataLog:
{
"resource": "/datalogs/datalog1"
}
Response structure
If successful, the method returns a string with a ticket ID.
Example
The following example shows a generated ticket ID for downloading and deleting the
DataLog:
"NDU2Nzg5MDEyMzQ1Njc4OTAxMjM0"
Web server
246 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.12 Reading information from SIMATIC Safety
5.12.1 Failsafe.ReadRuntimeGroups
This method outputs a list with all available F-runtime groups.
To call the Failsafe.ReadRuntimeGroups method, you need the "read_diagnostics" permission.
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-74 Failsafe_ReadRuntimeGroups_Response (object)
Name Required Data type Description
groups Yes array of Object array in which each object represents one F-runtime
Failsafe_ReadRuntimeGroups_E group.
ntry_Response
Examples
The following example shows the parameters of the response to a query with an F-runtime
group with remaining time "remaining_time".
{
"groups":
[
{
"name": "RTG_1",
"signature": "FD62F235",
"cycle_time_current": "PT0.110S",
"cycle_time_max": "PT0.200S",
"runtime_current": "PT0.050S",
"runtime_max": "PT0.080S"
}
]
Web server
Function Manual, 11/2023, A5E03484625-AK 247
API (Application Programming Interface)
5.12 Reading information from SIMATIC Safety
5.12.2 Failsafe.ReadParameters
With this method, you can read out fail-safe parameters of a fail-safe CPU or a fail-safe
module via the hardware ID of the module.
To call the Failsafe.ReadParameters method, you need the "read_diagnostics" permission.
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-77 Failsafe_ReadParameters_Response (object)
Name Required Data type Description
safety_mode No string Status message indicating whether safety mode is active
("enabled") or not ("disabled").
Note that this status message only applies to the CPU and
not to other modules.
type Yes string Defines whether the required hardware ID is the fail-safe
module or represents a different fail-safe module.
parameters No object Indicates whether the required hardware ID is the fail-
safe module with safety program or represents a differ
ent fail-safe module.
The returned object is alternatively of type:
• Failsafe_ReadParameters_Cpu_Response
• Failsafe_ReadParameters_Module_Response
Web server
248 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.12 Reading information from SIMATIC Safety
Examples
The following example shows the parameters of a fail-safe CPU in active safety mode.
{
"safety_mode": "enabled",
"type": "cpu",
"parameters":
{
"last_f_program_modification": "2023-11-05T18:25:43.510Z",
"collective_signature": "C572BC16"
}
}
The following example shows the parameters of a fail-safe module in active safety mode.
{
"type": "module",
"parameters":
{
"f_monitoring_time": "PT0.123S",
"f_source_address": 123,
"f_destination_address": 123,
"f_par_crc": "F062F235"
}
}
Web server
Function Manual, 11/2023, A5E03484625-AK 249
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
NOTE
HTTP-Range-Requests
For access to web application resources, the web Server provides you with a limited support
for HTTP range requests. These requests allow you to read individual areas of a resource.
Advantages
Web applications offer you advantages compared to the older method that provided
customer pages via the system function SFC 99 in STEP 7:
• The resources are saved in the associated web application. Via the Web API, you can
download the resources to your PC, edit them and upload them back to the CPU. This
procedure results in significantly reduced development times of customer pages.
• Unlike the previous customer pages, you can test the web application during
implementation without having to load it onto the CPU.
• You can access resources independent of the CPU mode (e.g. RUN, STOP) and update
these.
• Web applications are also available in the STOP mode of the CPU.
• No synchronization between the user program and Web server required by the SFC 99
instruction.
• You can access multiple CPUs within a web application using the Web API .
• The CPU supports saving multiple web applications that you can access simultaneously via
the HTTP end point.
• Access to the resources of a web application via the HTTP end point can be activated or
deactivated for each application. In so doing, an administrator can deactivate access to a
web application, for example, to update the resources consistently.
• You can specify a standard entry page for each application. When you visit the basic URL
of a web application, such as https://[ip]/~[application_name], you are automatically being
forwarded to the configured home page.
• You can specify an individual media type (MIME type) for each resource.
Web server
250 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
NOTE
When you use the Web API for managing web applications, the TIA Portal project in the
SIMATIC.S7S directory on the SIMATIC Memory Card changes. Your TIA Portal project is
extended by the option of saving resources (e.g. HTML, CSS, JavaScript, etc.) in the project
but outside of the data blocks of the user program.
As with the previous customer pages, the web applications must not contain any instructions
in the STEP 7 user program and are thus purely static files without dynamic content.
Web server
Function Manual, 11/2023, A5E03484625-AK 251
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
NOTE
The tilde symbol "~" is important in the path and must always exist for web applications.
Web server
252 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
NOTE
To ensure that the API token is not lost after the web page is called up again, you can save
the API token in a cookie or in the LoadStorage of the web browser, for example, using
JavaScript.
The behavior after timeout for protected web applications is the same as the behavior after
timeout for web API sessions: After a timeout, the cookie becomes invalid for access to the
protected web applications. Reloading a resource file of a web application does not extend
the session. Use appropriate methods of the Web API to stay logged in (see section Web API
Sessions (Page 163)).
Web server
Function Manual, 11/2023, A5E03484625-AK 253
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.1 WebApp.Create
With the WebApp.Create method, you can create a new web application in the CPU.
To call the WebApp.Create method, you need the "manage_user_pages" authorization.
Example
In the following example, the user creates an application with the name "application_1".
{
"name": "application_1",
"state": "enabled"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
254 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.2 WebApp.Delete
With the WebApp.Delete method, you delete an existing web application that was loaded by
the user with all its web page resources.
To call the WebApp.Delete method, you need the "manage_user_pages" authorization.
Example
In the following example, the user deletes an application with the name "application1".
{
"name": "application1"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
Function Manual, 11/2023, A5E03484625-AK 255
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.3 WebApp.Rename
With the WebApp.Rename method, you change the name of the web application to a new
name.
To call the WebApp.Rename method, you need the "manage_user_pages" authorization.
Example
In the following example, the user changes the name of the application from "application1"
to "application_new".
{
"name": "application1"
"new_name": "application_new"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
256 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.4 WebApp.Browse
The WebApp.Browse method returns alternatively:
• A list of all web applications with the associated properties.
• The properties for a specific web application
No authorization is required for calling the WebApp.Browse method.
Example
In the following example, the user specifies the name of the "application1" for the list.
{
"name": "application1"
}
Response structure
The following tables show the structure of server responses to successful requests.
Table 5-86 WebApp_Browse_Request (object)
Name Required Data type Description
max_applications yes number Maximum number of applications supported by the CPU
applications yes array of List of the applications in the CPU
WebApp_Browse_
Application_Respon
se
Web server
Function Manual, 11/2023, A5E03484625-AK 257
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
Example
In the following example, the user requests responses from the server.
{
"max_applications": 4,
"applications": [
{
"name": "application1",
"state": "enabled",
"type": "user",
"default_page": "index.html"
},
{
"name": "vottheapp",
"state": "enabled",
"type": "vot"
}
]
}
Web server
258 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.5 WebApp.SetState
With the WebApp.SetState method, you can activate or deactivate a web application that was
loaded by the user. A web application that was loaded by the user and is deactivated cannot
be called by the HTTP end point.
To call the WebApp.SetState method, you need the "manage_user_pages" authorization.
Example
In the following example, the user deactivates the application with the name "webapp":
{
"name": "webapp",
"state": "disabled"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
Function Manual, 11/2023, A5E03484625-AK 259
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.6 WebApp.SetDefaultPage
With the WebApp.SetDefaultPage method, you set a default page for a user-defined web
application. This page is loaded if you have not assigned a resource name when accessing the
web application.
To call the WebApp.SetDefaultPage method, you need the "manage_user_pages"
authorization.
Example
In the following example, the page "index.html" is used as a resource in the web application
"application_1".
{
"name": "application_1",
"resource_name": "index.html"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
260 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.7 WebApp.SetNotFoundPage
With the WebApp.SetNotFoundPage method, you set a page for a user-defined web
application. This page is loaded if you have used a resource name that does not exist when
accessing the web application.
To call the WebApp.SetNotFoundPage method, you need the "manage_user_pages"
authorization.
Example
In the following example, the page "404.html" is used as a resource in the "application_1"
web application.
{
"name": "application_1",
"resource_name": "404.html"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
Function Manual, 11/2023, A5E03484625-AK 261
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.8 WebApp.SetNotAuthorizedPage
With the WebApp.SetNotAuthorizedPage method, you set a publicly visible page for a user-
defined web application. This page is loaded if you have used a resource name that cannot be
accessed publicly (protected) when accessing the web application, thus accessing the web
application without a valid cookie.
You can get a valid cookie using the Api.Login (Page 171) method with the
"include_web_application_cookie" parameter.
To call the WebApp.SetNotAuthorizedPage method, you need the "manage_user_pages"
authorization.
Web server
262 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
Example
In the following example, the page "login.html" is used as a resource in the "application_1"
web application.
{
"name": "application_1",
"resource_name": "login.html"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
Function Manual, 11/2023, A5E03484625-AK 263
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.9 WebApp.BrowseResources
The WebApp.BrowseResources method provides a list of all resources with their properties
that are assigned to a web application.
To call the WebApp.BrowseResources method, you need the "manage_user_pages"
authorization.
Example
In the following example, the user specifies the name of the "application1" application for the
list.
{
"app_name": "application_1"
}
Response structure
The following tables show the structure of the server response to a successful request.
Table 5-93 WebApp_BrowseResources_Response (object)
Name Required Data type Description
max_resources yes number Maximum number of resources supported by
the CPU.
resources yes array of WebApp_BrowseResources_ List of the resources in the specific applica
Resource_Response tion.
Web server
264 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
Example
In the following example, the user requests responses from the server.
{
"max_resources": 200,
"resources": [
{
"name": "index.html",
"size": 24387,
"media_type": "text/html",
"etag": "896a9s8df0897g098a",
"visibility": "public",
"last_modified": "2020-08-24T07:08:06Z"
},
{
"file_name": "secret.js",
"size": 97826348,
"media_type": "application/javascript",
"visibility": "protected",
"last_modified": "2020-08-24T07:08:06Z"
}
]
}
Web server
Function Manual, 11/2023, A5E03484625-AK 265
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.10 WebApp.CreateResource
With the WebApp.CreateResource method, you create a new resource in a web application
that was loaded by the user on the CPU.
To call the WebApp.CreateResource method, you need the "manage_user_pages"
authorization.
Example
In the following example, the user creates a new resource "index.html" of the application
"application_1" with the media type "text/html".
{
"app_name": "application_1",
"name": "index.html",
"media_type": "text/html",
"last_modified": "2020-08-24T07:08:06Z"
}
Web server
266 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
Response structure
This method returns a character string that includes a valid ticket ID. The user uses this ticket
to upload the content of the resource to the CPU using the ticket end point.
NOTE
A maximum of only one WebApp.CreateResource ticket can be created. A new ticket can be
created for this method only after this ticket has been closed.
Web server
Function Manual, 11/2023, A5E03484625-AK 267
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.11 WebApp.DeleteResource
With the WebApp.Delete method, you can delete a resource from a specific web application.
To call the WebApp.DeleteResource method, you need the "manage_user_pages"
authorization.
Example
In the following example, the user deletes the resource "img/wrong.png" of the application
"application_1".
{
"app_name": "application1",
"name": "img/wrong.png"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
268 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.12 WebApp.RenameResource
With the WebApp.RenameResource method, you change the name of a resource in a specific
web application.
To call the WebApp.RenameResource method, you need the "manage_user_pages"
authorization.
Example
In the following example, the user changes the name of the resource to "corrspelled.png" in
the "application1" application.
{
"app_name": "application1",
"name": "msspelled.png",
"new_name": "corrspelled.png"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
Function Manual, 11/2023, A5E03484625-AK 269
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.13 WebApp.DownloadResource
With the WebApp.DownloadResource method, you can load a resource to a web application
that was loaded by the user from the CPU.
To call the WebApp.DownloadResource method, you need the "manage_user_pages"
authorization.
Example
In the following example, the user downloads the resource "secrets.pdf" of the application
"application_1".
{
"app_name": "application_1",
"name": "secrets.pdf"
}
Response structure
This method returns a character string that includes a valid ticket ID. The user uses this ticket
to download the content of the resource from the CPU using the ticket end point.
NOTE
Web server
270 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
An example of further processing of the ticket ID can be found in the Ticket mechanism (Page
164) section.
5.13.14 WebApp.SetResourceVisibility
With the WebApp.SetResourceVisibility method, you change the visibility of a resource, public
or protected, in a web application that was loaded by the user. A protected resource cannot
be called by the HTTP end point without authentication.
To call the WebApp.SetResourceVisibility method, you need the "manage_user_pages"
authorization.
Web server
Function Manual, 11/2023, A5E03484625-AK 271
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
Example
In the following example, the user sets the "secrets.html" resource of the "myapp" application
to "protected":
{
"app_name": "myapp",
"name": "secrets.html",
"visibility": "protected"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
272 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.15 WebApp.SetResourceETag
With the WebApp.SetResourceETag method, you change or delete the ETag attribute that is
returned when accessing the resource via the HTTP header. ETag (Entity Tag) is an HTTP
header field. It only serves to determine changes at the requested resource and is used to
avoid redundant data transfers.
To call the WebApp.SetResourceETag method, you need the "manage_user_pages"
authorization.
Example
In the following example, the user sets the ETag value to "09as7df09h8j23r" for the
"secrets.html" resource in the "myapp" application.
{
"app_name": "myapp",
"name": "secrets.html",
"etag": "09as7df09h8j23r"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
Function Manual, 11/2023, A5E03484625-AK 273
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.16 WebApp.SetResourceMediaType
With the WebApp.SetResourceMediaType method, you change the media type of a resource
in a web application that was loaded by the user.
To call the WebApp.SetResourceMediaType method, you need the "manage_user_pages"
authorization.
Example
In the following example, the user sets the media type to "image/jpeg" for the "secrets.jpg"
resource in the "myapp" application.
{
"app_name": "myapp",
"name": "secrets.jpg",
"media_type": "image/jpeg"
}
Response structure
If successful, the server returns the Boolean value "true".
Web server
274 Function Manual, 11/2023, A5E03484625-AK
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
5.13.17 WebApp.SetResourceModificationTime
With the WebApp.SetResourceModificationTime method, you set the modification time of a
resource in a web application that was loaded by the user.
To call the WebApp.SetResourceModificationTime method, you need the
"manage_user_pages" authorization.
Example
In the following example, the user sets the modification time to "24.08.2020 07:08:06" for
the "secrets.html" resource in the "myapp" application:
{
"app_name": "myapp",
"name": "secrets.html",
"last_modified": "2020-08-24T07:08:06Z"
}
Web server
Function Manual, 11/2023, A5E03484625-AK 275
API (Application Programming Interface)
5.13 Web applications that can be loaded by the user
Response structure
If successful, the server returns the Boolean value "true".
Web server
276 Function Manual, 11/2023, A5E03484625-AK
Glossary
API
Application Programming Interface
Automation system
An automation system is a programmable logic controller that consists of at least one CPU,
various input and output modules, as well as operating and monitoring devices.
AWP
Automation Web Programming
AWP commands
Special command syntax for exchanging data between CPU and HTML file.
Configuration
Systematic arrangement of individual modules (design).
CSS
A CSS (Cascading Style Sheet) specifies how an area or content marked up in HTML is
displayed.
Device
Device that can send, receive or amplify data via the bus, e.g., IO controller.
Diagnostics
The detection, localization, classification, visualization and further evaluation of errors,
malfunction and alarms.
Diagnostics provides monitoring functions that run automatically during plant operation. This
increases the availability of plants by reducing commissioning times and downtimes.
EBNF
Extended Backus-Naur form: Formal metalanguage to represent context-free grammar.
Formal languages can be expressed in EBNF; especially used in computer science for the
definition of programming languages. The EBNF is standardized by ISO as ISO/IEC
14977:1996(E).
Firewall
A firewall is used to restrict the network access based on sender or target address of the used
services. The firewall decides based on specified rules which of the network packets it
Web server
Function Manual, 11/2023, A5E03484625-AK 277
Glossary
handles are forwarded and which are not. This way the firewall tries to prevent unauthorized
network access.
It is not the function of a firewall to detect attacks. It only implements rules for network
communication.
HTTP
Hypertext Transfer Protocol (HTTP). Protocol for data transmission across a network.
HTTPS
Hypertext Transfer Protocol Secure (HTTPS). Protocol for tap-proof transmission of sensitive
data across a network.
Identification data
Identification data is stored on a module, and contains information which supports the user
in
• Checking the system configuration
• Locating hardware changes in a system
• Correcting errors in a system
Modules can be clearly identified online using the identification data.
JSON
JSON (JavaScript Object Notation) is a compact data format in an easy-to-read text form and
is used to exchange data between applications. JSON is independent of the programming
language. Parsers and generators exist in all common programming languages.
Master
The master in possession of the token is an active device. This master has the option to
receive data from other devices and to send data to other devices.
PROFIBUS
PROcess FIeld BUS, German process and fieldbus standard that is defined in
IEC 61784-1:2002 Ed1 CP 3/1. This standard specifies functional, electrical, and mechanical
properties for a bit-serial fieldbus system.
PROFIBUS is available with the protocols DP (= Distributed I/O), FMS (= Fieldbus Message
Specification), PA (= Process Automation), or TF (= Technological Functions).
PROFINET
Within the context of Totally Integrated Automation (TIA), PROFINET is the systematic
continuation of:
• PROFIBUS DP, the established fieldbus
• Industrial Ethernet, the communications bus for the cell level
Experiences from both systems have been are integrated in PROFINET.
PROFINET as an Ethernet-based automation standard of PROFIBUS International (formerly
PROFIBUS User Organization e.V.) thus defines a manufacturer-independent communication,
automation and engineering model.
Web server
278 Function Manual, 11/2023, A5E03484625-AK
Glossary
PROFINET components
A PROFINET component includes all data of the hardware configuration, the parameters of
the modules, and the associated user program. The PROFINET component comprises the
following elements:
• Technological Function
The (optional) technological (software) function includes the interface to other PROFINET
components as interconnectable inputs and outputs.
• Device
The device is the representation of the physical programmable controller or field device
including the I/O, sensors and actuators, mechanical parts, and the device firmware.
PROFINET IO
Within the context of PROFINET, PROFINET IO is a communication concept for implementing
modular, distributed applications.
PROFINET IO allows you to create automation solutions familiar from PROFIBUS.
Implementation of PROFINET IO is carried out on the one hand via the PROFINET standard for
programmable controllers and on the other by using the engineering tool STEP 7.
This means that you have the same application layer in STEP 7 – regardless of whether you
are configuring PROFINET or PROFIBUS devices. The programming of your user program is
identical for PROFINET IO and PROFIBUS DP when using the blocks and system status lists
expanded for PROFINET IO.
PROFINET IO controller
Device used to address connected I/O devices. This means that the IO controller exchanges
input and output signals with assigned field devices. The IO controller is often the controller
on which the automation program runs.
PROFINET IO device
A distributed field device that is assigned to one of the IO controllers (e.g., remote IO, valve
terminals, frequency converters, switches).
URL
Uniform Resource Locator (URL). Identifies and localizes a source, such as a web page,
uniquely via the method of access used and the location of the source in computer networks.
UTF-8
UTF-8 is the abbreviation for 8-bit UCS (Universal Character Set) Transformation Format.
UTF-8 is the most widely used encoding of Unicode characters.
Each Unicode character is assigned a specially encoded byte string of variable length. UTF-8
supports up to four bytes onto which all Unicode characters can be mapped.
Web browser
Web browsers are visualization programs for web pages and can communicate with Web
servers.
Web server
Function Manual, 11/2023, A5E03484625-AK 279
Glossary
Web server
280 Function Manual, 11/2023, A5E03484625-AK
Index
A Configuring
Backup, 97
Access restriction, 30 Restoring, 97
Activating the Web server, 26 Copy protection, 56
Alarms, 76 CPU-specific certificate, 31
API, 153 Customer pages
API endpoint, 158 Configuring customer pages, 139
Customer page as start page, 142
Application name, 253
Arrays, 188
D
Automatic updating, 29
Diagnostics (Motion Control), 64
AWP commands, 127
PLC tags, 128 Diagnostics buffer, 63
PLC tags, 130 Display of texts in different languages, 37
Special tags, 131
Download, 166
Enumeration types, 133
Fragments, 134
Arrays, 136 E
Structures, 137
East Asian languages, 37
End point
B API, 158
Backup of configuration, 98 Ticket, 166
Web applications that can be loaded by the user,
Binary representation, 185 252
Binding, 56
F
C Fail-safe, 62
CA certificate, 31 FAQs
Certificate Web server access via smartphone, 26
Web server certificate, 31 Download certificate, 28
Incorporating web pages with relative path
Certificate manager
names, 127
Local CPU-specific certificate, 31
Automatically updating web pages, 127
Global CA-signed certificate, 32
Customer page as start page, 143
Global security settings, 32
Filebrowser, 150
Communication, 78
System files, 150
Parameters, 79
Statistics, 81 Firmware update, 74
Resources, 82 F-runtime groups, 62
Connections, 83
Web server
Function Manual, 11/2023, A5E03484625-AK 281
Index
G R
Github, 159 Reading out service data, 151
Global security settings, 32 Reading PLC tags
Overview, 129
Tags of the String and Character type, 129
H String or character tags in expressions, 129
HTTPS, 27 Resource name, 253
Restoring the configuration, 99
I Runtime information, 57
Identification, 54
Diagnostics, 54 S
Module information, 71
Security functions, 22
J Self-signed certificates, 31
Signal table (Trace), 110, 110
JSON-RPC, 158, 165
Start page, 47
Intro, 47
K Log in, 51
Know-how protection, 56 Logout, 51
Statistics
Module information, 71
L Communication, 81
Language settings, 37
T
M Tags
Measurements (trace), 105 writing, 94
writing, 96
Media type
Name, 253 Technology objects
Status, errors, technology alarms, 64
Memory, 56
Ticket end point, 166
Motion Control
Diagnostics, 64 Ticket ID, 166
Service overview, 64 Ticket mechanism, 165
Ticket methods, 168
P Topology, 84
Program protection, 55 Set topology, 84
Actual topology, 84
Graphical view, 85
Tabular view, 88
Status overview, 90
Examples, 90
Trace recordings, 103
Trend diagram (Trace), 106
Web server
282 Function Manual, 11/2023, A5E03484625-AK
Index
U
Updating and saving, 46
Deactivating automatic updating, 46
Printing web pages, 46
Saving diagnostics buffer entries, 64
Saving alarms, 77
Updating user-defined pages, 126
Upload, 166
User-defined pages, 30
WWW instruction, 140
User-defined web applications, 250
User interface language
assigning to project language, 38
Setting, 48
User management, 39
User pages
Example user page, 144
W
Web access
Via PG/PC, 25
Via HMI devices and mobile terminal devices, 25
Web API, 153
supported data types, 185
Web applications, 250
WEB API
supported clients, 159
Web applications, 250
Web applications that can be loaded by the user,
250
Web browser, 23
Web server
Properties, 22
Certificate, 31
Web server certificate
creating and assigning, 31
Web server language, 29
Web server - web pages
Tag status, 93
Watch table, 95
Web server
Function Manual, 11/2023, A5E03484625-AK 283