104BWeb server
11.3 User-defined web pages
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
501
If a tag name or data block name includes special characters, you must use additional
quotation marks or escape characters as described in the topic Handling tag names that
contain special characters (Page 505).
11.3.2.6
Defining enum types
You can define enum types in your user-defined pages and assign the elements in an AWP
command.
Syntax
<!-- AWP_Enum_Def Name='<Enum type name>' Values='<Value>,
<Value>,... ' -->
Parameters
<Enum type
name>
Name of the enumerated type, enclosed in single or double quotation marks.
<Value>
<constant>:<name>
The constant indicates the numerical value for the enum type assignment. The total
number is unbounded.
The name is the value assigned to the enum element.
Note that the entire string of enum value assignments is enclosed in single quotation marks,
and each individual enum type element assignment is enclosed in double quotation marks.
The scope of an enum type definition is global for the user-defined Web pages. If you have
set up your user-defined Web pages in language folders (Page 522), the enum type
definition is global for all pages in the language folder.
Example
<!-- AWP_Enum_Def Name='AlarmEnum' Values='0:"No alarms", 1:"Tank is
full", 2:"Tank is empty"' -->
11.3.2.7
Referencing CPU variables with an enum type
You can assign a variable in the CPU to an enum type. This variable can be used elsewhere
in your user-defined Web page in a read operation (Page 495) or a write operation
(Page 496). On a read operation, the Web server will replace the numerical value that is
read from the CPU with the corresponding enum text value. On a write operation, the Web
server will replace the text value with the integer value of the enumeration that corresponds
to the text before writing the value to the CPU.
Syntax
<!-- AWP_Enum_Ref Name='<Varname>' Enum="<EnumType>" -->