Writing Special Variables - Siemens S7-1200 System Manual

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

Writing special variables

The Web server provides the ability to write values to the CPU from special variables in the
HTTP request header. For example, you can store information in STEP 7 about the cookie
associated with a user-defined Web page, the user that is accessing a page, or header
information. The Web server provides access to specific special variables that you can write
to the CPU when logged in as a user with privileges to modify variables.
Syntax
Parameters
Examples
In this example, the Web page writes the value of the HTTP special variable
"SERVER:current_user_id" to the PLC tag named "SERVER:current_user_id ".
In this example, the Web page writes the value of the HTTP special variable
"SERVER:current_user_id" to the PLC tag named "my_userid".
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
The type of special variable and is one of the following:
HEADER
SERVER
COOKIE_VALUE
Specific variable within the types defined above, as shown in these examples:
HEADER:Accept: content types that are acceptable
HEADER:User-Agent: information about the user agent originating the request.
SERVER:current_user_id: id of the current user; 0 if no user logged in
SERVER:current_user_name: name of the current user
COOKIE_VALUE:: value of the named cookie
Enclose the Name clause in single quotation marks.
If no Use clause is specified, the special variable name corresponds to a PLC
variable name. Enclose the complete Name clause within single quotation marks
and the PLC tag in double quotation marks. The special variable name must match
the PLC tag name exactly.
Refer to HTTP documentation for a list of all the names of HEADER variables.
The variable name in your STEP 7 program into which you want to write the special
variable, which can be a PLC tag name, or a data block tag.
The Varname must be enclosed in single quotation marks. Within the single
quotes, use double quotation marks around a PLC tag or 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.
Web server
11.6 User-defined Web pages
633
Table of Contents
loading

Table of Contents