Using An Enum Type - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents
Web server
11.6 User-defined Web pages
Sample HTML code
The following excerpt from the "Remote Wind Turbine Monitor" HTML page displays the text
"Power Output:" in the left cell of a table row and reads the variable for the power output and
displays it in the right cell of the table row along with the text abbreviation for kilowatts, kW.
The AWP command :="Data_block_1".PowerOutput: performs the read operation. Note that
data blocks are referenced by name, not by data block number (that is, "Data_block_1" and
not "DB1").

Power output:

:="Data_block_1".PowerOutput: kW

11.6.8.3

Using an enum type

The "Remote Wind Turbine Monitor" HTML page uses enum types for the three instances
where HTML page displays "ON" or "OFF" for a Boolean value, and for where the user sets
a Boolean value. The enum type for "ON" results in a value of 1, and the enum type for
"OFF" results in a value of 0. For example, consider the HTML code for reading and writing
the Manual Override Enable setting in "Data_block_1".ManualOverrideEnable value using an
enum type:
Sample HTML code
The following excerpts from the "Remote Wind Turbine Monitor" HTML page show how to
declare an enum type called "OverrideStatus" with values of "Off" and "On" for 0 and 1, and
then setting an enum type reference to OverrideStatus for the ManualOverrideEnable
Boolean tag in the data block named "Data_block_1".
Where the HTML page includes a display field in a table cell for the current state of
ManualOverrideEnable, it uses just a normal read variable command, but with the use of the
previously declared and referenced enum type, the page displays "Off" or "On" rather than 0
or 1.
2px; border-top-color: #ffffff;">

Manual override: :="Data_block_1".ManualOverrideEnable:

648
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Table of Contents
loading

Table of Contents