104BWeb server
11.3 User-defined web pages
S7-1200 Programmable controller
528
System Manual, 11/2011, A5E02486680-05
Possible techniques for using the fragment_index include:
●
Processing the current fragment: Leave fragment_index unchanged and set the continue
command.
●
Skip the current fragment: Set fragment_index to 0 and set the continue command.
●
Replace current fragment with a different fragment: Set the fragment_index to the new
fragment ID and set the continue command.
To check global states or request states that might be changing, the STEP 7 user program
must call the WWW instruction to evaluate the current values of these states. A typical usage
might be to call the WWW instruction periodically until a specific state occurs.
Note
If the STEP 7 user program sets more than one request command, the WWW instructions
processes only one in this of precedence: abort, finish, repeat, continue. The WWW
instruction clears all of the request commands after processing.
Examples
The following example shows a STEP 7 user program that is checking for a fragment with an
ID of 1 to be in the waiting state, following a prior call to the WWW instruction. It might also
wait for other application-specific conditions to occur. Then it performs whatever processing
is necessary for the fragment, such as setting data block tags, performing calculations, or
other application-specific tasks. Afterwards, it sets the continue flag so that the Web server
will execute this fragment.
When the program calls the WWW instruction with this modified control DB, the user-defined
Web page with this fragment can be displayed from the Web browser.
Note that this is a simplified example; the fragment to check could be in any one of the four
requesttab structs in the array.