Programming for experts
P.
112 of 349
Use of own Html code and
graphics on the Web server
Weboutput
Defintion of two output fields
Weboutputs are always global
Maximal 65000 Signs
HTML Code...
can also be adjusted dynamically
With the weboutput field of the web server, the user can show his own HTML code on the visu (vgl.
S. Fehler: Referenz nicht gefunden / 285). In the output field a simple text can be represented, but it
is also possible to represent dynamically a complex HTML code.
Incorrect or invalid HTML code in weboutput may interfere with the page layout. Such errors
are not corrected by the free support. Please work here with tools as shown on the link
http://www.quackit.com/html/online-html-editor/
Thereto you have to define the output field in the web server:
[WebServer]
page (2) [$Haus$,$Energie$]
weboutput(Out1)[QUAD,ICON] weboutput(Out2)[QUAD,NOICON]
[EibPC]
Out1=2
Out2=3
You can note that the weboutput field can only be set globally. The element can be displayed with or
without an icon (ICON or NOICON). The width is set to 2 unit width, the height can be set single
(SINGLE), double (DOUBLE) or quadruple (QUAD).
The restriction to global elements arises from the possibility that the Weboutput-box can absorb 65 Kbytes of data.
For 40 global elements, which make 2 MB, you have to keep free space in RAM for these items.
With the function
weboutput
(
ID,Data
)
is the data written of the field. In this case is
Data
a string with a maximum length of 65534 bytes
(type c65534). A special feature is that this string can be a valid html code. This makes it possible to
dynamic formatting and display.
We are going to describe the both at the outset specified fields so that a website as in Abbildung 2 is
created:
Abbildung 2: Gewünschte Ausgabe
For the creation of the actual HTML code, please refer to http://de.selfhtml.org. The Html code can
be preset using the website as the following:
if systemstart() then {
weboutput(Out1,$<h4>Berechnung der <i>Energieeffizienz</i></h4> <ul style="list-
style-type:disc"> <li>Obergeschoß: 10 kWh </li> <li> Untergeschoß: 10.3 kWh </li>
<li> Erdschoß: 2.3 kWh </li> </ul> _______________________ <br> Summe:
22.6 kWh $c10000)
} endif
You can note, that the code inside the $-Sign can't be wrapped. In the development it's
recommended to create and test the HTML code seperately.
With the help of an other dependency as the
if systemstart()
the text and the formatting can be
changed the whole time even during the term of the program.
The second weboutput field should also have its own graphic. At first a PNG or JPG data has to be
uploaded at the Enertex® EibPC. This could be done ex ante with the Enertex® EibStudio, which is
described on P. 200. The path of the graphic for the
weboutput
is
/upload/
+ data name. Thereby
the graph and some text and the HTML formatting will be initialize with the following statement:
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]