Enum Types - Siemens SIMATIC S7-1500 Function Manual

Web server
Hide thumbs Also See for SIMATIC S7-1500:
Table of Contents

Advertisement

Websites
3.8 User pages
3.8.1.3

Enum types

Enumeration types (enum types)
Enum types convert numerical values from the PLC program into texts or vice versa. The
numerical values may also be assigned for use with several languages.
Define enum types
You can define enum types in your user pages and assign the values in an AWP command.
Syntax
<!-- AWP_Enum_Def_Name='<Name Enum-Typ>' Values='0:"<Text_1>",
1:"<Text_2>",...,x:"<Text_y>"' -->
Examples
To store German values as HTML file in the "de" folder of the HTML directory:
<!-- AWP_Enum_Def Name="Enum1" Values='0:"on", 1:"off", 2:"Fault"' -
->
To store English values as HTML file in the "en" folder of the HTML directory:
<!-- AWP_Enum_Def Name="Enum1" Values='0:"on", 1:"off", 2:"error"' -
->
Assigning enum types to tags
The assignment of tags from the user program to the individual enum types takes place by
means of a separate AWP command. The used tag can be used at a different location of the
user pages in a read operation or in a write operation.
For a read operation, the Web server replaces the value read from the CPU with the enum
text value defined correspondingly. For a write operation, the Web server replaces the
defined enum text value with the corresponding integer value of the enumeration before the
value is written to the CPU.
Syntax
<!-- AWP_Enum_Ref_Name='<Varname>' Enum="<Enum-Type>" -->
<Varname> is the symbolic tag name from the user program; <Enum-Type> the previously
specified name of the enum type.
Example for a declaration
<!-- AWP_Enum_Ref_Name='"Alarm"' Enum="AlarmEnum" -->
Example for use when reading a tag
<!-- AWP_Enum_Def Name='AlarmEnum' Values='0:"No alarms",
1:"Container is full", 2:"Container is empty"' -->
<!-- AWP_Enum_Ref Name='"Alarm"' Enum="AlarmEnum" -->
...
<p> The current value of "Alarm" is :="Alarm": </p>
If the value of "Alarm" in the CPU is 2, the HTML page shows 'The current value of "Alarm" is
container is empty' because the definition of the enum type assigns the numerical value 2 to
the character sequence "Container is empty".
52
Function Manual, 01/2013, A5E03484625-01
Web server

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents