Thanks 99

81 Entries

The User-defined web pages are a nice new feature, available since the version 11 of the STEP 7.

The S7-1200 System manual has very good information about it. The objective o this tips is to complement it with the main steps to the configuration, collecting some extra information about the theme and give some sample programs.

Despite there is some differences between User-defined web pages of S7-300 and S7-1200, the documentation of the Applications & Tools “Visualization with user-defined web pages on SIMATIC CPUs with PROFINET interface” (http://support.automation.siemens.com/BR/view/en/44212999) has also general information about how is the structure and syntaxes of HTML pages (in special chapter “3 General Principles of Web Pages and User-defined Web Pages”).

There is an Applitation and Tool that descriptes (with example) the use of Web pages on S7-1200:

Include follow line before the header:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

That defines that it is the document type HTML in the language version V4.01 in the "Transitional" variant. The language code "EN" refers to the language of the tags, i.e. English.

Include follow line in the header:<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>

With "content="text/html", the MIME type is specified, followed by the used character set UTF-8.With the help of the Multipurpose Internet Mail Extensions (MIME) standard, the web browser is informed e.g. during an HTTP transfer which data the web server sends, for example whether it is clear text, an HTML document or a PNG image.

2.1.2) To show PLC values on the Web

To read PLC values and place it in the Web page, you need to use the symbolic or absolute name of the variables with the follow syntax::=<Variable name>:

You can predefine intern names and connect with the PLC names with the line:<!--AWP_Out_Variable Name='HTMLname' Use='PLCname' -->

Tip: When you work with DB, use only symbolic names and syntax like follow example:<!--AWP_Out_Variable Name='flag1' Use='"My_Data_Block".flag1' -->:=flag1:

Tip: If you need that the value are refreshed at fix intervals (without “F5”) you can place the line: <meta http-equiv="Refresh" content="10"> at the page header (10 = refreshed time, in seconds).

2.1.3) To write values to PLC

First: you need to “declare” the PLC variable as a comment with the special syntax. For example:<!-- AWP_In_Variable Name='"MyVariable"' -->

Syntax to write a value in an IO field (like input field in a HMI)<form method="POST"><input name='"MyVariable"' type="text"></form>

Syntax to read and write a value in an IO field (like input/output field in a HMI)<form method="POST"><input name='"MyVariable"' value=:="MyVariable": type="text"></form>

There others ways (by buttom, etc.) decrypted in the S7-1200 System Manual.

Tip:you need to be logged on to write values to the PLC. If you try to send values without to login, it will not work, however, without any signs of fault.

When the page is viewed, the tag does not display properly. If I do not use the AWP_Out_xxx, it works fine and displays, but it is kind of ugly looking in the source code.

These are in the header of the html source:[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><meta http-equiv="Content-Type"content="text/html; charset=utf-8">[/code]