Siemens SIMATIC S7-1500 Function Manual

Siemens SIMATIC S7-1500 Function Manual

Web server
Hide thumbs Also See for SIMATIC S7-1500:
Table of Contents
Web server
Table of Contents
loading

Summary of Contents for Siemens SIMATIC S7-1500

  • Page 1 Web server...
  • Page 2: Web Server

    Preface Function manuals Documentation Guide SIMATIC General information Web pages S7-1500, SIMATIC Drive Controller, ET 200SP, ET 200pro Web server Function Manual 11/2019 A5E03484625-AG...
  • Page 3: Legal Information

    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.
  • Page 4: Preface

    Web server user interface. The illustrations used can be transferred to the following CPUs: ● The CPUs of the SIMATIC S7-1500 automation system ● The CPUs of the SIMATIC Drive controller ● The CPUs of the ET 200SP Distributed I/O System ●...
  • Page 5: Web Server

    Preface 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 an API (Appli- Section API (Application Pro- Established standard mechanisms for •...
  • Page 6: Table Of Contents

    Preface 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 the infor- mation? New contents New web page "User files" You can download ASCII files (files in Section User files (Page 115) binary format) from the SIMATIC Memory Card, directory UserFiles\ to the web page...
  • Page 7: Web Server

    Preface 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 the infor- mation? New contents Handling of certificate modi- You protect the web server connection Section Configuring the Web fied against tapping or distortion of the com-...
  • Page 8: Web Page "Watch Tables

    Functions that you will be familiar with Manual CPU 1510SP-1 PN • contents range of the function manual from the SIMATIC S7-1500 CPUs are (https://support.industry.sie to the CPUs of the ET implemented in CPUs in other designs mens.com/cs/ww/en/view/9 200SP distributed I/O sys-...
  • Page 9: Web Server

    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.
  • Page 10: Web Server

    Preface 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). Catalogs for all the products in automation and drives are available on the Internet (https://mall.industry.siemens.com).
  • Page 11 Table of contents Preface ..............................3 Function manuals Documentation Guide ....................12 General information ..........................14 Properties of the Web server ....................14 Configuring the Web server ....................19 Language settings ........................29 Updating and saving information ................... 32 Web pages ............................33 Start page with general CPU information ................
  • Page 12 Table of contents 3.16 User pages ..........................120 3.16.1 AWP commands ........................124 3.16.1.1 PLC tags ..........................125 3.16.1.2 Special tags .......................... 129 3.16.1.3 Enum types ........................... 131 3.16.1.4 Fragments ..........................133 3.16.1.5 Arrays ............................ 135 3.16.1.6 Structures ..........................136 3.16.2 Configuring user pages ......................
  • Page 13: Function Manuals Documentation Guide

    Function manuals Documentation Guide The documentation for the SIMATIC S7-1500 automation system, for CPU 1516pro-2 PN based on SIMATIC S7-1500, and for the distributed I/O systems SIMATIC ET 200MP, ET 200SP and ET 200AL is divided into three areas. This division allows you easier access to the specific information you require.
  • Page 14: Web Server

    You must register once to use the full functionality of "mySupport". 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.
  • Page 15: General Information

    General information Properties of the Web server Benefits of the Web server The Web server enables monitoring and administering of the CPU by authorized users over a network. Evaluations, diagnostics, and modifications are thus possible over long distances. Monitoring and evaluation is possible without STEP 7, only a web browser is required. Note that you must take appropriate measures to protect the CPU from compromise (such as restricting network access, using firewalls).
  • Page 16: Web Server

    General information 2.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: ●...
  • Page 17: Web Server

    General information 2.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 enabled in your browser. Choose the "Automatically" option in the cache settings of your browser. If the cache is disabled or if a setting other than "Automatically"...
  • Page 18: Web Server

    General information 2.1 Properties of the Web server Reading out data With the Web server, you can read out the following data from the CPU and, in some cases, modify and write back the data to the CPU. ● Start page with general CPU information (Page 33) ●...
  • Page 19: Web Server

    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.
  • Page 20: Section Configuring The Web Server

    General information 2.2 Configuring the Web server Configuring the Web server To use the full functionality of the web server, the following settings in STEP 7 are necessary. Procedure You have opened the properties dialog of the CPU in STEP 7 in the project view. Figure 2-1 Web server settings in STEP 7 Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 21: Web Server

    General information 2.2 Configuring the Web server Activate web server on this module The web server is disabled in the default setting of a configured CPU. Proceed as follows to enable the Web server: 1. Open the "Devices & Networks" view by double-clicking in the project tree in STEP 7. 2.
  • Page 22: Web Server

    The activation of the web server using the secure transmission protocol "HTTPS" requires a valid web server certificate. For SIMATIC S7-1500 CPUs with firmware V2.0 or higher, you must create the certificate for the web server of the CPU yourself with STEP 7 and assign it to the web server in the properties of the CPU.
  • Page 23: Web Server

    General information 2.2 Configuring the Web server Creating a self-signed server certificate To create a self-signed Web server certificate, follow these steps: 1. in the Inspector window Properties of the CPU, "General" tab, navigate to the "Web server > Security" area. 2.
  • Page 24: Web Server

    Additional 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 function manual (https://support.industry.siemens.com/cs/ww/en/view/59192925) and to the STEP 7 online help, keyword "Secure Communication". Web server...
  • Page 25: Web Server

    You can find instructions for installing the certificate in the help system of your Web browser and in the FAQ with the entry ID 103528224 at the Service&Support (https://support.industry.siemens.com/cs/ww/en/view/103528224) website. Note To protect against manipulation from the outside, download the certificate only in an environment that is guaranteed not to be compromised.
  • Page 26: Web Server

    General information 2.2 Configuring the Web server Access protection The certificate establishes an encrypted connection that prevents tapping or distortion of the communication but does not provide access protection. This means you have to protect your CPU from unauthorized access with the corresponding configuration in the user management.
  • Page 27: Web Server

    General information 2.2 Configuring the Web server Setting the language for the Web In total, you can assign up to three different project languages to the user interface languages of the Web server. In STEP 7, activate the project languages that you want to use and then assign one of the activated project languages to each of the web server interface languages.
  • Page 28: Web Server

    General information 2.2 Configuring the Web server In STEP 7, you can manage the user list in the "Web server > User administration" 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.
  • Page 29: Web Server

    S7-300/1500 F-CPU" in the manual SIMATIC Safety - Configuring and Programming (http://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.
  • Page 30: Language Settings

    General information 2.3 Language settings Activation of the Web server for specific interfaces In the area "Overview of interfaces", you have the option to enable access to the Web server. Figure 2-5 Activation of access to the Web server via the interfaces Language settings Introduction The Web server provides the user interface in the following languages:...
  • Page 31: Web Server

    General information 2.3 Language settings Requirements for the availability of the East Asian languages The following requirements must be met for the East Asian languages: ● The appropriate package for the support of East Asian languages is installed on the display device (such as PC).
  • Page 32: Web Server

    General information 2.3 Language settings Setting the language for the Web Once you have activated the Web server on your module, assign a project language of the STEP 7 project from the drop-down list to each interface language. 1. Navigate to the "Multilingual support" area in the Inspector window Properties of the CPU, "General"...
  • Page 33: Updating And Saving Information

    General information 2.4 Updating and saving information Updating and saving information Updating the screen content Automatic updating is activated in the default setting. The preset update time is 10 s. You update the web pages manually via the function key . Disabling automatic updating for an individual web page Click to temporarily deactivate automatic updating for a web page.
  • Page 34: Section Start Page With General Cpu Information

    Web pages Start page with general CPU information Connecting to the Web server Establish a connection to the Web server by entering the IP address of the interface of the configured CPU which is connected to the client in the address bar of the web browser, for example, http://192.168.3.141 or https://192.168.3.141.
  • Page 35: Web Server

    Web pages 3.1 Start page with general CPU information Setting the user interface language You can change the language for the Web server interface, e.g., from English to German, in the upper right corner. This option is available to you on all web pages of the Web server. Switching the time display You can set the format of the time display to Coordinated Universal Time (UTC) or PLC local time (default setting) on the left next to the language setting.
  • Page 36: Web Server

    Web pages 3.1 Start page with general CPU information The switchover has an effect on the following Web pages: Table 3- 1 Switching the time display: Display on Web pages Web pages Display as Coordinated Universal Time (UTC) or as PLC local time Start page Last F-change...
  • Page 37: Web Server

    Web pages 3.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.
  • Page 38: Web Server

    Web pages 3.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.
  • Page 39: Diagnostics

    "Fail-safe" contains additional information on the F-CPU. Further information about the specification is available in the Programming and Operating Manual SIMATIC Safety - Configuring 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 19).
  • Page 40: Web Server

    Web pages 3.2 Diagnostics ①"Identification" The "Identification" info box contains the plant and location designation and the serial number. Plant and location identifiers can be configured in STEP 7 in the properties dialog of the CPU in the "General" tab. ②"Order number"...
  • Page 41: Web Server

    Web pages 3.2 Diagnostics ②"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. ●...
  • Page 42: Web Server

    Web pages 3.2 Diagnostics "Runtime information" tab Current information on program/communication load and cycle time can be found in the "Runtime information" tab. This enables you to see whether there may be runtime problems during execution of your user program. Figure 3-10 "Runtime information"...
  • Page 43: Web Server

    Web pages 3.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.
  • Page 44: Web Server

    Web pages 3.2 Diagnostics Figure 3-12 Color legend If you click on a specific color, the selected color is highlighted in the chart. If you click on a highlighted color, you remove the highlighting. Measurement of load distribution and cycle time The "Measurement of load distribution and cycle time"...
  • Page 45: Web Server

    Web pages 3.2 Diagnostics Example 1: Figure 3-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 <...
  • Page 46: Web Server

    Web pages 3.2 Diagnostics Example 3: Figure 3-15 Cycle time longer than maximum cycle time Example 3 shows that the CPU can no longer process the user program within the maximum cycle time when the maximum communication load is reached. If the predicted cycle time is longer than the maximum cycle time, the chart outputs an error message.
  • Page 47: Web Server

    You can find additional information about the influence of the communication on the cycle time in the Cycle and Response Times (https://support.industry.siemens.com/cs/us/en/view/59193558) function manual. Trend for program/communication load If your browser supports the display of SVG (Scalable Vector Graphics), the display in the "Runtime information"...
  • Page 48: Web Server

    Web pages 3.2 Diagnostics 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.
  • Page 49: Diagnostics Buffer

    Web pages 3.3 Diagnostics buffer 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".
  • Page 50: Motion Control Diagnostics

    Web pages 3.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 29).
  • Page 51: Web Server

    Web pages 3.4 Motion Control diagnostics Diagnostics The "Diagnostics" view offers you: ① ● An overview list of the configured technology objects ② ● The status and error messages of a selected technology object ③ ● Values and limits of the status of a selected axis/cam ①...
  • Page 52: Web Server

    Web pages 3.4 Motion Control diagnostics Meaning of the symbols in the "Status" column Table 3- 2 Meaning of symbols Symbol Symbol Meaning color Green Component is OK Yellow Warning pending Error - component faulty or not available Select the required technology object. The related diagnostics information is shown in the bottom tabs.
  • Page 53: Web Server

    Web pages 3.4 Motion Control diagnostics ③ "Motion status"/"Cam track status" tab You use the "Motion status" tab to monitor the motion status of the axis as in STEP 7. Figure 3-21 Motion Control diagnostics: Motion status Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 54: Web Server

    Web pages 3.4 Motion Control diagnostics You use the "Cam track status" tab to monitor the cam track status as in STEP 7. Figure 3-22 Motion Control diagnostics: Cam track status Service overview The "Service overview" view offers you: ① ●...
  • Page 55: Web Server

    Web pages 3.4 Motion Control diagnostics ① "Service overview" view The "Service overview" shows the diagnostics information for several technology objects in table form. Figure 3-23 Motion Control diagnostics, service overview: Status and error information Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 56: Web Server

    Web pages 3.4 Motion Control diagnostics To select the information to be displayed, click the list symbol in the first column of the table. Make your selection in the next window. Click the list symbol again to leave the selection window. Figure 3-24 Motion Control diagnostics, service overview: Configuring the status and error information...
  • Page 57: Web Server

    Additional information You can find additional information in the S7-1500(T) Motion Control function manuals on the Internet (https://support.industry.siemens.com/cs/ww/en/view/109751049). You can find explanations of the diagnostics functions "Status and error bits" and "Motion status"/Cam track status" of the individual technology objects in the online help for STEP 7.
  • Page 58: Section Module Information

    Web pages 3.5 Module information Module information Module information The status of a device is indicated by means of symbols and comments on the "Module information" web page. Figure 3-26 Module information Meaning of the symbols in the "Status" column Table 3- 3 Meaning of symbols Symbol...
  • Page 59: Web Server

    Web pages 3.5 Module information Navigation to further module levels The status of individual components/modules/submodules is displayed when you navigate to the further module levels: ● To the next higher module level using the links in the display of the module levels ●...
  • Page 60: Web Server

    Web pages 3.5 Module information ④ "IP address" If a link is available, you can use it to access the Web server of the configured device you selected. ⑤ "Details" Additional information about the selected module is provided in the "Status" and "Identification"...
  • Page 61: Web Server

    Web pages 3.5 Module information ⑧ "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.
  • Page 62: Web Server

    Web pages 3.5 Module information Example: Module information - module Figure 3-29 Example: Module information - module 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.
  • Page 63: Firmware Update

    Web pages 3.6 Firmware update Firmware update Introduction You update the firmware as a user with the corresponding access rights on the "Module information" web page at the module level. You will find information on user management in section Configuring the Web server (Page 19) under "Amending user management". You use an update file to update the firmware of the CPU, the display of the CPU, or the individual central or distributed modules.
  • Page 64: Web Server

    ● 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 (http://support.automation.siemens.com). ① Status of the selected firmware file ②...
  • Page 65: Web Server

    If you click "Cancel", the CPU remains in STOP mode and you can run additional updates. Figure 3-33 Alarm: Firmware successfully transferred Reference For additional 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). Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 66: Alarms

    The alarm texts were configured in the user-specific languages. For information about configuring alarm texts, refer to STEP 7 and to the Service&Support pages (http://www.siemens.com/automation/service&support). Alarms To receive compact information on fault analysis, we recommend that you always first read out the content of the alarm buffer.
  • Page 67: Web Server

    Web pages 3.7 Alarms ① "Alarms" Alarms of the CPU are displayed in descending chronological order with date and time in info ① 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.
  • Page 68: Communication

    Web pages 3.8 Communication Communication Overview The "Communication" web page provides detailed information about the following tabs: ● Parameters ● Statistics ● Resources ● Connections ① "Parameter" tab A summary of the information on the PROFINET and Ethernet interfaces of the selected CPU is available in the "Parameter"...
  • Page 69: Web Server

    Web pages 3.8 Communication ④ "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 Function Manual, 11/2019, A5E03484625-AG...
  • Page 70: Web Server

    Web pages 3.8 Communication ① "Statistics" tab Information on the data transmission can be found on the "Statistics" tab. Figure 3-36 "Statistics" tab with key data on data transmission ② "Total statistics - Sent data packages" You can assess the data transmission on the transmit line based on the key data in this info box.
  • Page 71: Web Server

    Web pages 3.8 Communication ③ "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.
  • Page 72: Web Server

    Web pages 3.8 Communication ① "Connections" tab The "Connections" tab contains information on the status of the communication connections. Figure 3-38 "Connections" tab ② Status Under "Status", you will find an overview of the communication connections being established and the already established communication connections. For each connection, the table contains the following information: status of the connection, local ID, slot of gateway, remote address (IP address), the corresponding remote address type, method of connection, and type of connection.
  • Page 73: Section Topology

    Web pages 3.9 Topology Topology 3.9.1 Introduction Topology of the PROFINET devices The "Topology" web page provides information on the topological configuration and status of the PROFINET devices on your PROFINET IO system. There are three tabs for the following views: ●...
  • Page 74: Graphical View

    Web pages 3.9 Topology 3.9.2 Graphical view Requirements For error-free operation of the topology, the following conditions must be met: ● You have made the Language settings (Page 29). ● 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).
  • Page 75: Web Server

    Web pages 3.9 Topology Meaning of the colored connections in the set/actual topology: Table 3- 4 Meaning of the colored connections in the set/actual topology Connection Meaning Set topology Actual topology Green The current actual connection matches the configured target Connections detected connection.
  • Page 76: Web Server

    Web pages 3.9 Topology ⑤ PROFINET devices of a different PROFINET IO subsystem ● In the set topology: A PROFINET device of a different PROFINET IO subsystem is indicated by means of a green link (or red link for interchanged ports) if it is available on the bus and directly ①...
  • Page 77: Tabular View

    Web pages 3.9 Topology Reference Additional examples for graphical topology view are available in the section Examples for graphical topology views (Page 79). 3.9.3 Tabular view Topology - tabular view The "Tabular view" always shows the "Actual topology". Figure 3-40 Topology - tabular view ①...
  • Page 78: Web Server

    Web pages 3.9 Topology ② Meaning of the symbols relating to the module status of the PROFINET devices Table 3- 6 Meaning of the symbols relating to the module status of the PROFINET devices Symbol Color Meaning green Component is OK. gray Deactivated PROFIBUS slaves or PROFINET devices black...
  • Page 79: Status Overview

    Web pages 3.9 Topology 3.9.4 Status overview Topology - status overview The "Status overview" provides a clear presentation of all PROFINET IO devices/PROFINET devices (without connection relations) on one page. A quick error diagnostics is possible based on the symbols that show the module statuses. The overview also provides a link of the modules to the Web page Module information (Page 57).
  • Page 80: Examples For Graphical Topology Views

    Web pages 3.9 Topology 3.9.5 Examples for graphical topology views The following section shows, as an example, some displays of the different topology views for a simple project. "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.
  • Page 81: Web Server

    Web pages 3.9 Topology "Set topology" with failed device If a device has failed in the meantime, this device remains in the same place in the "Set topology" view. The failed device is displayed with a red border around the device header and the icon.
  • Page 82: Web Server

    Web pages 3.9 Topology "Set topology" with interchanged ports If a port was interchanged for a configured, directly adjacent PROFINET device, this device remains in the same place in the "Set topology" view. The interchanged connection is indicated by a red line. Figure 3-46 "Set topology"...
  • Page 83: Tag Status

    Web pages 3.10 Tag status 3.10 Tag status Tag status The 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 84: Web Server

    Web pages 3.10 Tag status ① "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.
  • Page 85: Web Server

    Web pages 3.10 Tag status Special considerations when changing languages You can change the language, e.g., from German to English, in the upper right corner. Note that the German mnemonics differ from those of the other languages. For monitoring available data types Basically, you can monitor all data types of PLC tags via the web server, which you can also monitor in STEP 7.
  • Page 86: Watch Tables

    Web pages 3.11 Watch tables 3.11 Watch tables 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.
  • Page 87 Web pages 3.11 Watch tables ③ "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. ⑤...
  • Page 88: Online Backup

    Web pages 3.12 Online backup 3.12 Online backup Backing up and restoring the CPU configuration You can back up a CPU configuration using the Web server with the corresponding access rights. If necessary, you can also restore this configuration at a later time using the Web server.
  • Page 89 Web pages 3.12 Online backup Online backup Figure 3-49 Online backup Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 90 ● Entries in the diagnostic buffer are not included in the backup. ● With a SIMATIC S7-1500 CPU, the current time is not saved. ● The complete content of the SIMATIC memory card is saved, i.e. also any data stored on the card (e.g.
  • Page 91 Web pages 3.12 Online backup Restoring the configuration To restore the CPU configuration, follow these steps: 1. Enter the password of the currently logged-in user in the "Restore PLC" area. 2. Click the "Select file" button and select the backup file of the configuration that you want to restore.
  • Page 92 Web pages 3.12 Online backup 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.
  • Page 93: Section Record

    Web pages 3.13 Record 3.13 Record Trace and logic analyzer function You record device tags and evaluate the recordings with the trace and logic analyzer function. Tags are, for example, drive parameters or system and user tags of a CPU. The recordings are saved on the device and can be read out by users with appropriate access rights via the Web server and saved.
  • Page 94 Web pages 3.13 Record Space requirements for storing trace recordings The "Save measurements on device (memory card)" function in STEP 7 saves Trace recordings on your SIMATIC memory card. Response when number reached The "Deactivate recording" parameter repeats the measurements until the configured "Number of measurements"...
  • Page 95 The user interface of the "Trace" website 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 on this.
  • Page 96 Web pages 3.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 "Curve diagram and bit track" area. Figure 3-52 Displaying an individual measurement To display multiple measurement at once, right-click on a measurement to select it from the...
  • Page 97 Web pages 3.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 3- 7 Web server shortcut menu commands in the trace recordings area...
  • Page 98 Web pages 3.13 Record Toolbar of the trend diagram As in STEP 7, the buttons on the function bar of the trend diagram provide you with tools for adjusting the display. The following table shows the Web server buttons in the trend diagram toolbar: Table 3- 8 Buttons of the trend diagram toolbar Symbol...
  • Page 99 Web pages 3.13 Record Symbol Function Description Arrange in tracks Activate or deactivate the trace arrangement. When the trace arrangement is activated the signals are arranged among themselves with the relevant value axes. Signal groups are displayed in the same trace. This setting does not affect the display for the bit tracks.
  • Page 100 Web pages 3.13 Record Trend diagram The trend diagram displays the selected signals of a recording. Bits are shown in the lower diagram as a bit track. ① Trace recordings (minimized) ② Toolbar of the trend diagram ③ Trend diagram and bit track ④...
  • Page 101 Web pages 3.13 Record Use of the trend diagram ② You can zoom the display area as you like. Measurement cursors (see " Toolbar of the trend diagram") can be used to select individual values for display in the signal table. The following image shows how you can change the display area of the trend diagram as required with rulers and scroll bars.
  • Page 102 Web pages 3.13 Record Using the mouse wheel ● If you activate the mouse wheel in the display, you move the display up or down. ● If you activate the mouse wheel in the display while keeping the shift key pressed, you move the display to the left or right.
  • Page 103 Web pages 3.13 Record Column Description Open bit selection Individual bits can also be selected for the following data types for display as a bit track in the lower curve diagram: Byte, Word, DWord, LWord • SInt, USInt, Int, UInt, DInt, UDInt, LInt, ULInt •...
  • Page 104 Web pages 3.13 Record The following table shows the possible Web server shortcut menu commands of the "Signals" tab: Table 3- 10 Web server shortcut menu commands of the "Signals" tab Shortcut menu command Description "Scale Y automatically" Automatic scaling of the selected signal in Y direction. "Show signal"...
  • Page 105 Web pages 3.13 Record The following table shows the settings and displays for the measurements: Column Description Alignment of the measurements Trigger/Sample Alignment of the measurements in accordance with the trigger or measurement point. The individual zero point for the measurement is predefined in the table under the "Align- ment"...
  • Page 106 Web pages 3.13 Record Settings and displays in the "Calculated signal" tab You can use this function to calculate new signals based on real signals. The system calculates the Y-values of the signal points in the process. To parameterize the signals to be calculated, open the "Calculated signal" tab. In the "General"...
  • Page 107 Web pages 3.13 Record Basic mode (expression) In this mode you use the following to create your code: ● Standardized JavaScript expressions and operators (for example +, -, /, *, %, ~, &, |, ?, !) ● Standardized math libraries ●...
  • Page 108 Web pages 3.13 Record Advanced mode (JavaScript) This mode offers you an advanced functional scope for the calculation of the Y value by means of a complex JavaScript code. You can, for example, specify own static tags for the iteration of code sections: Figure 3-62 Advanced mode (JavaScript) The following table shows all the elements that you can use for your code:...
  • Page 109 Web pages 3.13 Record Every signal point consists of the following attributes: 1. x (measuring point) 2. t (relative ^time in milliseconds) 3. y (Y value) 4. points (number of signal points that are available for the calculation of a new signal) In "Advanced Mode (JavaScript)"...
  • Page 110 Web pages 3.13 Record You also have the possibility to 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. Figure 3-64 Real signals of the "Signals"...
  • Page 111 Web pages 3.13 Record 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.
  • Page 112 Web pages 3.13 Record Settings and displays of the Snapshot icon With the "Snapshot" icon in the toolbar of the trend diagram you save the current signal course in the form of a snapshot. To create a snapshot of the signal course click the icon.
  • Page 113: Section Datalogs

    Web pages 3.14 DataLogs 3.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: ●...
  • Page 114: Section Automated Reading Out Of Data Logs

    Web pages 3.14 DataLogs 3.14.1 Automated reading out of DataLogs In addition to the downloading of individual DataLogs via the user interface of the Web server, you can download, read out and archive DataLogs. Automatic downloading of DataLogs is realized either by the execution of scripts in, for example, Bash or on your HTML user page via JavaScript.
  • Page 115 Web pages 3.14 DataLogs Downloading of the DataLogs via JavaScript The following example shows how you can download DataLogs automatically by using JavaScript. Replace the URL of the example by the correct IP address of the interface of your CPU at this URL and use the appropriate transfer protocol (HTTP or HTTPS). ...
  • Page 116: Section User Files

    Web pages 3.15 User files 3.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"...
  • Page 117 Web pages 3.15 User files "User files" Web page The browser displays the content of the SIMATIC memory card, directory UserFiles\ on the "User files" Web page. You can sort the UserFiles according to the individual parameters in ascending or descending order.
  • Page 118: Automatically Read Or Upload User Files

    Web pages 3.15 User files 3.15.1 Automatically read or upload user files In addition to the Web server's user interface, you can automatically list, delete, download and upload UserFiles. Use JavaScript or Bash for this, for example. Opening UserFiles from the SIMATIC memory card The CPU makes a URL in the following format available so that you can list UserFiles automatically from the SIMATIC memory card of your CPU: http[s]://[ip]/UserFiles?Action=List...
  • Page 119 Web pages 3.15 User files Uploading UserFiles to the SIMATIC memory card The CPU makes a URL in the following format available so that you can upload UserFiles automatically to the SIMATIC memory card of your CPU: http[s]://[ip]/UserFiles?Action=UPLOAD The following example shows how you can upload a UserFile to your HTML user page automatically using JavaScript.
  • Page 120 Web pages 3.15 User files Downloading UserFiles via JavaScript The following example shows how you can download UserFiles automatically using JavaScript. Replace the URL of the example by the correct IP address of the interface of your CPU at this URL and use the appropriate transfer protocol (HTTP or HTTPS). ...
  • Page 121: User

    Web pages 3.16 User pages 3.16 User pages User pages In the "User pages" area of the Web server you can upload HTML pages you have created yourself for reading out data of the target system. Figure 3-69 User pages You create the pages with an HTML editor of your choice from which you generate data blocks (Web control DB and Fragment DBs) in STEP 7 and download them to the CPU.
  • Page 122 Web pages 3.16 User pages Requirements ● You have assigned symbolic names to the tags you want to use on your web page in STEP 7 . ● In the Inspector window under "Properties > General > Web server", you have at least: –...
  • Page 123: Section User Pages (Pa Ge

    Web pages 3.16 User pages Creating user pages You can use any HTML editor to create your own user page(s). Make sure that your HTML code complies with the standards of the W3C (World Wide Web Consortium), because STEP 7 does not check the HTML syntax in any way. In addition to the simple HTML code, you can also use JavaScript commands in your user pages.
  • Page 124 Internet (http://www.ecma-international.org/ecma-262/5.1/). For more information about how to automatically update web pages and how to incorporate user 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. Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 125: Awp Commands

    Web pages 3.16 User pages 3.16.1 AWP commands Overview Automation Web Programming (AWP) commands are a special command syntax for exchanging data between the CPU and the user page (HTML file). AWP commands are entered as HTML comments and offer you the following options for your user-defined pages: ●...
  • Page 126: Plc Tags

    Web pages 3.16 User pages Overview of AWP commands Table 3- 11 AWP commands Function Representation :=: Reading PLC tags Writing PLC tags Reading special tags Writing special tags ...
  • Page 127 Web pages 3.16 User pages Reading PLC tags These out-tags (output direction as seen from the controller) are inserted at any place in the HTML text with the syntax described below. Syntax :=: corresponds to the tag to be read from your STEP 7 project and can be a simple shared tag or a complete tag path to a structural element.
  • Page 128 Web pages 3.16 User pages Using String or Character tags in expressions On your HTML page, you use an expression in which the character string for reading a tag is enclosed in quotation marks, for example in forms. Possible HTML code used:
  • Page 129 Web pages 3.16 User pages Writing PLC tags These in-tags (input direction as seen from the controller) are set on the browser page. This can take place in a form on your HTML page, for example, with text input or list selection boxes that correspond to the tags that can be written.
  • Page 130: Special Tags

    Web pages 3.16 User pages 3.16.1.2 Special tags 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. Reading special tags The web server can read PLC tags and pass them to special tags in the HTTP response header.
  • Page 131 Web pages 3.16 User pages Writing special tags The web server allows you to write values of special tags written in the HTTP header to the CPU. In STEP 7, for example, you can store information on the cookie of a user page or on the user who accesses a page.
  • Page 132: Enum Types

    Web pages 3.16 User pages 3.16.1.3 Enum types Enumeration types (enum types) Enum types convert numerical values from the PLC program into texts or vice versa. The numerical values may also be assigned for use with several languages. Define enum types You can define enum types in your user pages and assign the values in an AWP command.
  • Page 133 Web pages 3.16 User pages Example of how to use when reading a tag

    The current value of "Alarm" is :="Alarm":

    If the value of "Alarm"...
  • Page 134: Fragments

    Web pages 3.16 User pages 3.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.
  • Page 135 Web pages 3.16 User pages 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.
  • Page 136: Arrays

    Web pages 3.16 User pages 3.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 ...
  • Page 137: Structures

    Web pages 3.16 User pages Representation of arrays of the BOOL data type The output of arrays of the BOOL type is always filled to the next full 8 bits. This particular feature only occurs with BOOL arrays. Example: "DB_1".bitArray is a BOOL array with 5 elements. ...
  • Page 138 Web pages 3.16 User pages 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. :=A: :=B: :=C: ...
  • Page 139: Configuring User

    Web pages 3.16 User pages 3.16.2 Configuring user pages Configuring user pages Figure 3-71 Configure user-defined pages in STEP 7 To configure the user-defined pages in STEP 7, 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".
  • Page 140: Programming The Www Instruction

    Web pages 3.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.
  • Page 141 Web pages 3.16 User pages Programming the WWW instruction The user program must execute the WWW instruction in order that the user-defined pages can be called in the Web server. Table 3- 12 WWW instruction LAD/FBD Description ret_val Access to user pages by means :=WWW(ctrl_db:=uint_in_) of the Web server Parameters...
  • Page 142: Defining The User Page As Start Page

    Web pages 3.16 User pages 3.16.4 Defining the user page as start page Defining the user page as start page In addition to the default intro page, you can also define the start page of your user pages as the start page of the Web server. Figure 3-72 Example of user page as start page of the Web server Requirements...
  • Page 143 Web pages 3.16 User pages Procedure To define the user-defined 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".
  • Page 144: Example Of A User Page

    3.16 User pages Reference You can find additional information on the topic of user 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. 3.16.5 Example of a user page 3.16.5.1 Website for monitoring and controlling a wind turbine...
  • Page 145 Web pages 3.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.
  • Page 146: Reading And Displaying Data From The Cpu

    Web pages 3.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.
  • Page 147 Web pages 3.16 User pages 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 executes the read operation. The data :="Data_block_1".PowerOutput block is referenced here by its symbolic name and not by its number ("Data_block_1"...
  • Page 148: Using Enum Types

    Web pages 3.16 User pages 3.16.5.3 Using enum types Definition of enum types The described user page uses enum types in three locations. "On" or "Off" is displayed for a Boolean value at these locations. The enum type for "On" results in a value of 1, the enum type for "Off" results in a value of 0. The following statements from the HTML code of the user page show the declaration of an enum type with the name "OverrideStatus"...
  • Page 149: Writing User Inputs Into The Controller

    Web pages 3.16 User pages 3.16.5.4 Writing user inputs into the controller 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"...
  • Page 150: Writing Special Tags

    Web pages 3.16 User pages 3.16.5.5 Writing special tags Using special tags The user page "Remote Wind Turbine Monitor" writes the special tag "Server:current_user_id" into a tag of the CPU. The tag value contains the value "1" if a user is logged on and "0"...
  • Page 151: Html Code Of The User Page "Remote Wind Turbine Monitor

    Web pages 3.16 User pages 3.16.5.6 HTML code of the user page "Remote Wind Turbine Monitor" The complete HTML code of the example user page "Remote Wind Turbine Monitor" as well as the used Cascading Style Sheet (CSS) is listed below. Wind_turbine.html
  • Page 152 Web pages 3.16 User pages Remote monitoring of wind turbines

    Remote Wind Turbine Monitor: Turbine #:="Data_block_1".TurbineNumber:

    Wind speed:

    ...
  • Page 153 Web pages 3.16 User pages
  • Yaw override: :="Data_block_1".YawOverride:

    Set:

    Turbine yaw:

    ...
  • Page 154 Web pages 3.16 User pages

    %

  • Wind_turbine.css BODY { background-image: url('./Wind_turbine.jpg') background-position: 0% 0%; background-repeat: no-repeat; background-size: cover; H2 { font-family: Arial; font-weight: bold; font-size: 14.0pt; color: #FFFFFF; margin-top:0px;...
  • Page 155: Filebrowser

    Web pages 3.17 Filebrowser 3.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.
  • Page 156: Reading Out Service Data

    Web pages 3.18 Reading out service data 3.18 Reading out service data The Web server gives you the option to save service data. In addition to the content of the diagnostic buffer, they include additional information on the internal status of the CPU. If you should encounter a problem with the CPU that cannot be resolved otherwise, you therefore have the option to submit the service data to the Service&Support team.
  • Page 157: Basic Websites

    Web pages 3.19 Basic websites 3.19 Basic websites Web pages with reduced contents Basic websites are offered for display devices with smaller screens, for example HMI, on the Web server. Basic websites are web pages with reduced content that are adapted to the requirements of small screens with low resolution.
  • Page 158 Web pages 3.19 Basic websites The basic websites are displayed as follows: Figure 3-77 Example basic websites, "Status" web page Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 159: Api (Application Programming Interface)

    Web pages 3.20 API (Application Programming Interface) 3.20 API (Application Programming Interface) 3.20.1 Web API The CPU offers you a Web-based API (Web API) as an interface for reading and writing CPU data. Connection established between CPU, Web API and terminal device. The following graphic shows an example of the Web API between CPU and terminal device.
  • Page 160 Web pages 3.20 API (Application Programming Interface) Availability The Web API is only available for CPUs as of firmware version from V2.8 for the following systems: ● the CPUs of the S7-1500 automation system (the CPUs of the S7-1500R/H redundant system are not supported) ●...
  • Page 161 Web pages 3.20 API (Application Programming Interface) Supported clients The products and versions listed in the following table were tested for the Web API. The "Version" column lists the most recently tested version at the time of going to press. In addition, other Versions may also work, especially newer versions.
  • Page 162: The Available Web Api Methods

    Web pages 3.20 API (Application Programming Interface) 3.20.2 The available Web API methods The following section gives an overview of all available Web API methods with extracts from the corresponding HTML code. Note Files which contain Web API methods must be encoded and stored in the UTF-8 character encoding.
  • Page 163: Api.login

    Web pages 3.20 API (Application Programming Interface) 3.20.2.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.
  • Page 164: Api.getpermissions

    Web pages 3.20 API (Application Programming Interface) Possible error messages The following table shows the possible error messages of the Api.Login method. Error code Error message Meaning Login failed The user name and/or password are not valid. Assign a reliable user name and password.
  • Page 165: Api.browse

    Web pages 3.20 API (Application Programming Interface) 3.20.2.3 Api.Browse The Api.Browse method gives you a list of all methods that you can call via the Web API. This provides you with an overview of all the methods supported by the CPU. No authorizations are needed for calling the Api.Browse method.
  • Page 166: Api.version

    Web pages 3.20 API (Application Programming Interface) 3.20.2.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 respective version ● the hardware release number of the CPU This information allows you to implement applications that correspond to the functionality of the contacted CPU.
  • Page 167: Api.getcertificateurl

    Web pages 3.20 API (Application Programming Interface) 3.20.2.6 Api.GetCertificateUrl The Api.GetCertificateUrl method returns a relative URL (https:// 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"...
  • Page 168 Web pages 3.20 API (Application Programming Interface) Web API examples The following section contains related examples of how you can use the described methods in the Web API. The examples use HTML, JSON and JQuery library for asynchronous requests. 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 specification.
  • Page 169 Web pages 3.20 API (Application Programming Interface) Example 2 Example 2 shows a client that wants to log on to the CPU with JavaScript and calls several methods 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"...
  • Page 170: Web Api Sessions

    Web pages 3.20 API (Application Programming Interface) 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.
  • Page 171: Read And Write Process Data

    Web pages 3.20 API (Application Programming Interface) Limitations for Web API sessions The CPU limits the number of active sessions. The following table shows the limitations based on the memory platform used. CPUs Limitation S7-1510 to S7-1513 S7-1515 and S7-1516 S7-1517 and S7-1518 Limitation of the active Web API sessions If you request another authentication token and none are available, then the request is...
  • Page 172 Web pages 3.20 API (Application Programming Interface) Supported data types The following table shows: ● The data types supported by the Web API for reading and writing process values ● the representation in the Web API ● The respective match of the data type in the TIA Portal Name of the data type Name of the data type Representation in the Web API...
  • Page 173 Web pages 3.20 API (Application Programming Interface) Name of the data type Name of the data type Representation in the Web API in the TIA Portal in Web API lword LWord JSON string with a numerical representation of an unsigned integer ba- sed on the number 10 in a range from 0 to 18 446 744 073 709 551 615 ulint ULInt...
  • Page 174 Web pages 3.20 API (Application Programming Interface) Name of the data type Name of the data type Representation in the Web API in the TIA Portal in Web API 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.
  • Page 175 Web pages 3.20 API (Application Programming Interface) Name of the data type Name of the data type Representation in the Web API in the TIA Portal in Web API JSON string with a numerical representation of an unsigned integer ba- sed 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 midnight (12:00:00.0 am).
  • Page 176: Parameter Assignment Of The Block Properties

    Web pages 3.20 API (Application Programming Interface) 3.20.5.2 Parameter assignment of the block properties Configuring access to the Web API in the TIA Portal To restrict the read and write access to data blocks of your project, you can define the desired parameters in the attributes of the respective block.
  • Page 177: Plcprogram.read

    Web pages 3.20 API (Application Programming Interface) 3.20.5.3 PlcProgram.Read The PlcProgram.Read method is used to read process data from the CPU. To call the PlcProgram.Read method, you need the "read_value" authorization. Structure of the request The following table informs you about the properties of the tag to be read. Name Required Data type...
  • Page 178: Plcprogram.write

    Web pages 3.20 API (Application Programming Interface) Possible error messages The following table shows the possible error messages of the PlcProgram.Read method. Error code Error message Meaning Internal error An internal error occurred while trying to perform the requested operation. Permission denied The current authentication token is not authorized to call this method.
  • Page 179 Web pages 3.20 API (Application Programming Interface) 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"...
  • Page 180: Plcprogram.browse

    Web pages 3.20 API (Application Programming Interface) Response structure If the write operation was successful, the server returns the Boolean value "true". Possible error messages The following table shows the possible error messages of the PlcProgram.Read method. Error code Error message Meaning Internal error An internal error occurred while trying to perform the requested operation.
  • Page 181 Web pages 3.20 API (Application Programming Interface) Example 1 In the following example the user searches the root node of the CPU. "mode": "children" The following example shows a possible response from the server. "name": "TestDB", "has_children": true, "db_number": 2, "datatype": "datablock"...
  • Page 182 Web pages 3.20 API (Application Programming Interface) Example 3 In the following example, the user requests information about a specific tag. "var": "\"MyDB\".MyStruct.MyField", "mode": "var" The following example shows a possible response from the server. "name": "MyDateTimeValue", "db_number": 2, "datatype": "date_and_time", "array_dimensions": [ "start_index": 0, "count": 3...
  • Page 183: Possible Error Messages

    Web pages 3.20 API (Application Programming Interface) PlcProgram_Browse_Response (Objekt-Array) Name Required Data type Description area 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 string Data type of the tag...
  • Page 184: Website For Monitoring And Controlling A Wind Turbine

    Web pages 3.20 API (Application Programming Interface) 3.20.6 Website for monitoring and controlling a wind turbine Example of a user page Here you see a user page for monitoring and controlling a wind turbine: Figure 3-81 Overview of user page wind turbine Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 185 Web pages 3.20 API (Application Programming Interface) The user page was created in English in this example, but you can select any language you wish when you create your own user page. If you have the corresponding rights, you have read and write access to the turbine parameters via the Web API.
  • Page 186 Web pages 3.20 API (Application Programming Interface) api.css .modal { display: block; position: absolute; background-color: #f1f1f1; min-width: 160px; max-height: 600px; border-radius: 0.8rem; overflow-y: auto; padding: 20px; box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); top: 30%; left: 50%; z-index: 10; transform: translate(-50%, -50%);...
  • Page 187 Web pages 3.20 API (Application Programming Interface) index.html [example] Turbine controls Please log in first
    ...
  • Page 188 Web pages 3.20 API (Application Programming Interface)

    You are using Api version:
  • Page 189 Web pages 3.20 API (Application Programming Interface) api.js "use-strict" let messageId = 1 let TARGET_IP = "https://192.168.2.132/api/jsonrpc" let AUTH_TOKEN = null function ping() { if (AUTH_TOKEN !== null) { fetch(TARGET_IP, { method: "POST", headers: { "Content-type": "application/json", "X-Auth-Token": AUTH_TOKEN body: JSON.stringify({ "id": messageId++, "jsonrpc": "2.0", "method": "Api.Ping"...
  • Page 190 Web pages 3.20 API (Application Programming Interface) function turbSpeed() { if (AUTH_TOKEN !== null) { let turbSp = document.getElementById("turb-speed-sp") fetch(TARGET_IP, { method: "POST", headers: { "Content-type": "application/json", "X-Auth-Token": AUTH_TOKEN body: JSON.stringify({ "id": messageId++, "jsonrpc": "2.0", "method": "PlcProgram.Write", "params": { "var": "\"turbine_speed_sp\"", "value": parseFloat(turbSp.value) .then(response =>...
  • Page 191 Web pages 3.20 API (Application Programming Interface) function turbineSpeedOverride(element) { if (AUTH_TOKEN !== null) { fetch(TARGET_IP, { method: "POST", headers: { "Content-type": "application/json", "X-Auth-Token": AUTH_TOKEN body: JSON.stringify({ "id": messageId++, // id can be omitted, in that case it is a notification request "jsonrpc": "2.0", "method": "PlcProgram.Write", "params": {...
  • Page 192 Web pages 3.20 API (Application Programming Interface) .then(response => response.json()) .then((data) => { AUTH_TOKEN = data.result.token document.getElementById("notice").innerHTML = "You are logged in" getApiVersion() getTurbineNumber() bulkReadValues() showBtn("btn-logout") hideBtn("btn-login") closeModal() .catch(e => console.error(e)) function bulkReadValues() { if (AUTH_TOKEN !== null) { let turbSpeedMax = document.getElementById("turb-speed-val") let turbAccelMax = document.getElementById("turb-accel-val") let turbJerkMax = document.getElementById("turb-jerk-val") fetch(TARGET_IP, {...
  • Page 193 Web pages 3.20 API (Application Programming Interface) .then(response => response.json()) .then((data) => { turbSpeedMax.innerHTML = data[0].result turbAccelMax.innerHTML = data[1].result turbJerkMax.innerHTML = data[2].result function bulkWriteValues() { if (AUTH_TOKEN !== null) { let turbSpeedMaxSp = document.getElementById("turb-speed-max- sp") let turbAccelMaxSp = document.getElementById("turb-accel-max- sp") let turbJerkMaxSp = document.getElementById("turb-jerk-max-sp") fetch(TARGET_IP, { method: "POST",...
  • Page 194 Web pages 3.20 API (Application Programming Interface) .then(response => response.json()) .then((data) => { bulkReadValues() function getApiVersion() { let label = document.getElementById("version-label") fetch(TARGET_IP, { method: "POST", headers: { "Content-type": "application/json", "X-Auth-Token": AUTH_TOKEN body: JSON.stringify({ "id": messageId++, "jsonrpc": "2.0", "method": "Api.Version" .then(response => response.json()) .then((data) =>...
  • Page 195 Web pages 3.20 API (Application Programming Interface) fetch(TARGET_IP, { method: "POST", headers: { "Content-type": "application/json", "X-Auth-Token": AUTH_TOKEN body: JSON.stringify({ "id": messageId++, "jsonrpc": "2.0", "method": "Api.Logout", .then(response => response.json()) .then((data) => { AUTH_TOKEN = null openModal() hideBtn("btn-logout") showBtn("btn-login") document.getElementById("notice").innerHTML = "Please log in first"...
  • Page 196 Web pages 3.20 API (Application Programming Interface) function openModal() { if (AUTH_TOKEN !== null) { alert("Already logged in.") else { let modal = document.getElementById("example-modal") modal.style.display = "block" Web server Function Manual, 11/2019, A5E03484625-AG...
  • Page 197: Glossary

    Glossary 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. Automation Web Programming AWP commands Special command syntax for data exchange between CPU and HTML file. Configuration Systematic arrangement of individual modules (design).
  • Page 198 Glossary 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 ●...
  • Page 199 Glossary PROFINET component A PROFINET component includes the entire data of the hardware configuration, the parameters of the modules, and the corresponding user program. The PROFINET component is made up as follows: ● Technological Function The (optional) technological (software) function includes the interface to other PROFINET components in the form of interconnectable inputs and outputs.
  • Page 200 Glossary UTF-8 Abbreviation for 8-bit UCS (Universal Character Set) transformation format. Most popular coding of Unicode characters. Each Unicode character is assigned a specially coded byte string of variable length in this format. UTF-8 supports up to four bytes on which all Unicode characters can be mapped. Web browser Web browsers are visualization programs for web pages and can communicate with Web servers.
  • Page 201: Index

    Index Configuring Backup, 87 Restoring, 87 Access restriction, 29 Copy protection, 40 Activating the Web server, 20 CPU-specific certificate, 21 Alarms, 65 Automatic updating, 25 AWP commands, 124 Diagnostics (Motion Control), 49 Arrays, 135 Diagnostics buffer, 48 Enumeration types, 131 Display of texts in different languages, 30 Fragments, 133 PLC tags, 125, 128...
  • Page 202 Index HTTPS, 24 Security functions, 14 Select technology objects, 56 Self-signed certificates, 21 Identification, 38 Service overview, 54 Diagnostics, 38 Signal table (Trace), 101, 101 Module information, 59 Start page, 33 Intro, 33 Log in, 36 Logout, 36 Know-how protection, 39 Statistics Communication, 69 Language settings, 29...
  • Page 203 Index Saving alarms, 66 Saving diagnostics buffer entries, 49 Updating user pages, 123 User interface language assign to project language, 31 Setting, 34 User management, 26 User pages, 120 Configuring user pages, 138 Example user page, 143 User page as start page, 141 WWW instruction, 139 User-defined pages, 28 Web access...

This manual is also suitable for:

Simatic et 200proSimatic et 200sp

Table of Contents