Using Enum Types - Siemens SIMATIC S7-1500 Function Manual

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

Advertisement

3.16.5.3

Using enum types

Definition of enum types
The described user page uses enum types in three locations. "On" or "Off" is displayed for a
Boolean value at these locations.
The enum type for "On" results in a value of 1, the enum type for "Off" results in a value of 0.
The following statements from the HTML code of the user page show the declaration of an
enum type with the name "OverrideStatus" and the values "0" and "1" for "Off" or "On" as
well as the definition of an enum type reference from "OverrideStatus" to the tag
"ManualOverrideEnable" in the data block "Data_block_1".
Note
Assignment of enum types
If the user page writes into a tag by using an enum type, there has to be a declaration
"AWP_In_Variable" for each "AWP_Enum_Ref" declaration.
The code used in the example is:
<!-- AWP_In_Variable Name='"Data_block_1".ManualOverrideEnable' -->
<!-- AWP_Enum_Def Name="OverrideStatus" Values='0:"Off",1:"On"' -->
<!-- AWP_Enum_Ref Name='"Data_block_1".ManualOverrideEnable'
Enum="OverrideStatus" -->
The following code describes a display box for displaying the current status of
"ManualOverrideEnable". A normal read command for tags is used but because of the
declared and referenced enum type, the website displays the values "On" and "Off" instead
of "1" and "0".
<td style="width:24%; border-top-style: Solid; border-top-width:
2px; border-top-color: #ffffff;">
<p>Manual override: :="Data_block_1".ManualOverrideEnable:</p>
</td>
The following code describes a drop-down list for changing "ManualOverrideEnable" by the
user. The drop-down list consists of the "Yes" and "No" options that are assigned to the "On"
or "Off" values by means of the enum type reference. If you make no selection, the status
remains the same.
<select name='"Data_block_1".ManualOverrideEnable'>
<option value=':"Data_block_1".ManualOverrideEnable:'> </option>
<option value="On">Yes</option>
<option selected value="Off">No</option>
</select>
The drop-down list is included in the form on the website. The form is uploaded, when the
user clicks on the "Submit override settings and values" button. If the user has selected
"Yes", the value "1" is written in the tag "ManualOverrideEnable" in the "Data_block_1" data
block; if the user has selected "No", the value "0" is written.
Web server
Function Manual, 11/2019, A5E03484625-AG
Web pages
3.16 User pages
147

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic et 200proSimatic et 200sp

Table of Contents