Siemens S7-1200 System Manual page 636

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Web server
11.6 User-defined Web pages
Parameters
<Varname>
<EnumType>
The scope of an enum type reference is the current fragment.
Example usage in a variable read
<!-- AWP_Out_Variable 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 displays 'The current value of "Alarm"
is Tank is empty' because the enum type definition (Page 635) assigns the text string "Tank
is empty" to the numerical value 2.
Example usage in a variable write
<!-- AWP_Enum_Def Name='AlarmEnum' Values='0:"No alarms", 1:"Tank is
full", 2:"Tank is empty"' -->
<!-- AWP_In_Variable Name='"Alarm"' Enum='AlarmEnum' -->...
<form method="POST">
<p><input type="hidden" name='"Alarm"' value="Tank is full" /></p>
<p><input type="submit" value='Set Tank is full' /><p>
</form>
Because the enum type definition (Page 635) assigns "Tank is full" to the numerical value 1,
the value 1 is written to the PLC tag named "Alarm" in the CPU.
Note that the Name clause in the AWP_In_Variable declaration must correspond exactly to
the Name clause in the AWP_Enum_Ref declaration.
Example usage in a variable write with use of an alias
<!-- AWP_Enum_Def Name='AlarmEnum' Values='0:"No alarms", 1:"Tank is
full", 2:"Tank is empty"' -->
<!-- AWP_In_Variable Name='"Alarm"' Enum='AlarmEnum'
Use='"Data_block_4".Motor1.Alarm'-->...
<form method="POST">
<p><input type="hidden" name='"Alarm"' value="Tank is full" /></p>
<p><input type="submit" value='Set Tank is full' /><p>
</form>
Because the enum type definition (Page 635) assigns "Tank is full" to the numerical value 1,
the value 1 is written to the alias "Alarm" which corresponds to the PLC tag named
"Motor1.Alarm" in data block "Data_Block_4" in the CPU.
636
Name of PLC tag or data block tag to associate with the enum type, or the name of
the alias name for a PLC tag (Page 634) if declared.
Varname must be enclosed in single quotation marks. Within the single quotes, use
double quotation marks around a PLC tag or data block name. Note that for data
block tags, you use the name of the block and not a data block number. The data
block name is within the double quotes but not the data block tag name.
Name of the enumerated type, which must be enclosed in single or double
quotation marks
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG

Advertisement

Table of Contents
loading

Table of Contents