Enum Types - Siemens SIMATIC S7-1500 Function Manual

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

Advertisement

3.16.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:"an", 1:"aus", 2:"Störung"'
-->
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.
During a read operation, the web server replaces the value read from the CPU with the
correspondingly defined enum text value. During 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> of the
previously defined name of the enum type.
Example for a declaration
<!-- AWP_Enum_Ref Name='"Alarm"' Enum="AlarmEnum" -->
Web server
Function Manual, 11/2019, A5E03484625-AG
Web pages
3.16 User pages
131

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic et 200proSimatic et 200sp

Table of Contents