Using Enum Types - Siemens SIMATIC S7-1500 Function Manual

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

Advertisement

3.8.4.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 excerpts 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 specification of an enum type reference of "OverrideStatus" for 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 "Send" 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, 01/2013, A5E03484625-01
Websites
3.8 User pages
61

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents