Defining Enum Types; Referencing Cpu Variables With An Enum Type - Siemens S7-1200 System Manual

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

Advertisement

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 639).
11.6.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>
<Value>
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 656), 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.6.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 629) or a write operation
(Page 630). 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_In_Variable Name='<Varname>' Enum="<EnumType>" -->
<!-- AWP_Out_Variable Name='<Varname>' Enum="<EnumType>" -->
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Name of the enumerated type, enclosed in single or double quotation marks.
<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.
Web server
11.6 User-defined Web pages
635

Advertisement

Table of Contents
loading

Table of Contents