Writing Variables - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Web server
11.6 User-defined Web pages
11.6.2.2

Writing variables

User-defined pages can write data to the CPU. This is accomplished by using an AWP
command to identify a variable in the CPU to be writable from the HTML page. The variable
must be specified by PLC tag name or data block tag name. You can declare multiple
variable names in one statement. To write the data to the CPU, you use standard HTTP
POST commands.
A typical usage is to design a form in your HTML page with text input fields or select list
choices that correspond to writable CPU variables. As with all user-defined pages, you then
generate the blocks from STEP 7 such that they are included in your STEP 7 program.
When a user with privileges to modify variables subsequently accesses this page and types
data into the input fields or selects a choice from a select list, the Web server converts the
input to the appropriate data type for the variable, and writes the value to the variable in the
CPU. Note that the name clause for HTML input fields and HTML select lists uses syntax
typical for the name clause of the AWP_In_Variable command. Typically enclose the name in
single quotation marks and if you reference a data block, enclose the data block name in
double quotation marks.
For form management details, refer to documentation for HTML.
Syntax
<!-- AWP_In_Variable Name='<Varname1>' [Use='<Varname2>'] ... -->
Parameters
<Varname1>
<Varname2>
For both Name clauses and Use clauses, the complete name must be enclosed in single
quotation marks. Within the single quotes, use double quotation marks around a PLC tag
and double quotation marks around a data block name. The data block name is within the
double quotes but not the data block tag name. Note that for data block tags, you use the
name of the block and not a data block number.
630
If no Use clause is provided, Varname1 is the variable to be written. It can be a
PLC tag name from your STEP 7 program or a tag from a specific data block.
If a Use clause is provided, Varname1 is an alternate name for the variable
referenced in <Varname2> (Page 634). It is a local name within the HTML page.
If a Use clause is provided, Varname2 is the variable to be written. It can be a PLC
tag name from your STEP 7 program or a tag from a specific data block.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG

Advertisement

Table of Contents
loading

Table of Contents