8/9/2011 9:35 PM | |
Joined: 9/23/2005 Last visit: 8/27/2024 Posts: 4347 Rating:
|
Hi, 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. 1 - Documentation: The main documentation about this theme could be found in the S7-1200 System Manual (http://support.automation.siemens.com/BR/view/en/36932465 ), in special chapter “13.3 User-defined web pages”. 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: "Creating and using user-defined web pages on S7-1200" http://support.automation.siemens.com/WW/view/en/58862931 2 – Main steps to configure a User-defined Web page 2.1 Create a Web page 2.1.1) Header, general information of the HTML page. 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. 2.2 – Device configuration CPU properties; Tab Web server: active the check box “Enable Web server on this module”. In the box User-defined Web pages, give the directory and the Default HTML page of your web page. Click in “Generate blocks” 2.3 – User Program Call the block WWW in your main block (e.g. OB1) and give the number of the DB (e.g. 333). |
Last edited by: Pegaia at: 4/25/2012 12:46 PMLast edited by: Pegaia at: 8/9/2011 9:45 PMDenilson Pegaia |
|
This contribution was helpful to
33 thankful Users
|
8/9/2011 9:47 PM | |
Joined: 9/23/2005 Last visit: 8/27/2024 Posts: 4347 Rating:
|
This treads shows a sample program about Web pages. It has just a fix text to be showed. Editing it, it is possible to see, as comment, a little explanation about the main structure of the HTML source. AttachmentExample1.zip (7457 Downloads) |
Denilson Pegaia |
|
This contribution was helpful to
11 thankful Users |
8/9/2011 9:48 PM | |
Joined: 9/23/2005 Last visit: 8/27/2024 Posts: 4347 Rating:
|
This second example shows how to see a PLC variable in the web interface.
AttachmentExample2.zip (6235 Downloads) |
Denilson Pegaia |
|
This contribution was helpful to
11 thankful Users |
8/9/2011 9:49 PM | |
Joined: 9/23/2005 Last visit: 8/27/2024 Posts: 4347 Rating:
|
This third example shows how to write a value to a PLC variable by the web interface.
AttachmentExample3.zip (6048 Downloads) |
Denilson Pegaia |
|
This contribution was helpful to
11 thankful Users |
8/15/2011 8:09 PM | |
Joined: 9/23/2005 Last visit: 8/27/2024 Posts: 4347 Rating:
|
Hi, Mr. Bakerjw has gently gives us a V11 project with the sample program listed in the chapter 13.3.8.1 of the S7-1200 System Manual ("wind turbine"). Thanks foryour help Follow attached. AttachmentRemoteMonitor_HTML_4_0.zip (6460 Downloads) |
Denilson Pegaia |
|
This contribution was helpful to
14 thankful Users |
1/20/2012 3:16 PM | |
Joined: 7/7/2010 Last visit: 8/30/2024 Posts: 15125 Rating:
|
Ok, I'm trying to get some custom names to work using the AWP_Out_Variable. System: CPU1214C, FW 2.2 configured and installed Software: TIA Portal Basic V11 SP2 An example that does not work is when I define like this: <!--AWP_Out_Variable Name='adHP' Use='"FromAD".Hyd_Pump_MS' --> Then in the HTML file, I try to display the value like this: :=adHP: Blocks generate fine. Compiles fine with warning : WebInt: PLC tag adHP not found. 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] Whatis wrong? |
science guy |
|
Follow us on