Web server
12.7 User-defined Web pages
S7-1200 Programmable controller
1052 System Manual, V4.2, 09/2016, A5E02486680-AK
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 1050) 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.
If a tag name or data block name includes special characters, you must use additional
quotation marks or escape characters as described in the topic Handling tag names that
contain special characters (Page 1055).
Note
Previous releases required a separate AWP_Enum_Ref declaration to associate
a variable
with a defined enum type. STEP
7 and the S7-1200 support existing code with
AWP_Enum_Ref declarations; however, this command is no longer needed.
STEP 7 converts and stores user-defined Web pages as a control DB and fragment DBs
when you click "Generate blocks" in the CPU Properties for the Web server. You can set up
specific fragments for specific pages or for sections of specific pages. You can identify these
fragments by a name and number with the "Start_Fragment" AWP command. Everything in
the page following the AWP_Start_Fragment command belongs to that fragment until
another AWP_Start_Command is issued or until end of file is reached.
<!-- AWP_Start_Fragment Name='<Name>'
[Type=<Type>][ID=<id>][Mode=<Mode>] -->