Commands and functions
P.
248 of 349
Display (Webdisplay)
Definition
●
Function
webdisplay
(
id, text, icon, state, style, [mbutton]
)
Arguments
●
Arguments
id, icon, state, style
and
mbutton
of data type u08
●
Argument
text
of arbitrary data type
Effect
●
The function addresses the web button (
button
or
shifter
). If there are multiple web buttons
with
id
, they all will be addressed.
●
With the optional argument
mbutton
the list of the drop-down menu can be changed.
●
Calling this function sets the icon of the web element with
id
to the symbol defined by
icon
(data type u08). Possible images are shown on page 291 and are selected by predefined
numbers (data type u08). In addition, predefined constants facilitate the choice. Their
respective allocation is listed in Table 2 (page 159)
●
The argument
text
denominates an arbitrary variable the value of which, converted to a
character string, is displayed in the variable text line of the web element.
●
Every icon has at least the states ACTIVE (==1), INACTIVE (==2), DARKRED (==0) and
BRIGHTRED (==9). One of these states can be submitted as the argument
state
. For an
overview of the possible states see Table 3 (page 159).
●
The text to be displayed can be represented in the stylesGREY (==0), GREEN (==1),
BLINKRED(==2) and BLINKBLUE (==3).
Data type result (Return)
●
none
Example show current time
A
button
element shall display the current time.
Implementation in the user program:
[WebServer]
button(ClockWebID)[CLOCK]$Uhrzeit$2
[EibPC]
ClockWebID=0
if stime(0) then webdisplay(ClockWebID,settime(),CLOCK,INACTIVE,GREY) endif
Note:
1.
The data type of the return value of
settime
() is t24. In this case, it is converted to a
readable character string of the notation „Fr. 12:33:55“.
2.
You can access to variables defined in the section
[EibPC]
. But consider, the webserver
evaluates the variable statically. When the variable
ClockWebID
is changing during run-
time, the index
ClockWebID
will still use its initial value, which is 0.
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]