Programming - First steps
P.
80 of 349
Defining a page
Working with IDs makes it easier
later on
Local element:
The element is bound to the page.
Global element:
The element is displayed identically
on all pages.
Global IDs may match local ones.
However, separate objects are
addressed.
In the following, we will show the application with multiple pages.
When using multiple pages, it makes sense to divide this pages thematically into groups, e.g.
basement. Each page will have its own heading, e.g. central heating room. The web server displays
this assignment in the listbox of the page navigation (cf. Figure 37).
Figure 37: Page navigation
To generate a page-oriented visualization, we need at first the page element in section
[WebServer]
.
[WebServer]
page(CentralHeatingRoomPageID)[$Basement$,$Heating$]
[EibPC]
CentralHeatingRoomPageID=1
A page is, therefore, generated by
page
(ID)[$GroupName$,$PageName$
This command generates the page assignment automatically. If a page has been assigned to a
group by this command, in the above example to “Basement”, it appears in this order in the selection
list box. The page itself has the name “Heating“. The quick selection (forward and back button,
respectively, in Figure 37) is given by the order of the definition.
By
header
and
footer,
you can switch off the internal header and footer, respectively. Besides, you
have the possibility to embed a graphic from an external source. The design of the the header and
the footer is identical on every page.
There exist global and local elements for the visualization. Global means that an element can be
used on different pages, but has been instanced only once. Accessing or changing the element via
the application program is therefore identical for all pages. However, a local element can be changed
and accessed only on one page. Local and global elements have an identical design. Local
elements are differ to global ones by the prefix “p” (page). The page numbering starts with 1. To
exemplify this, we extend the above code:
[WebServer]
// Page 1
page(CentralHeatingRoomPageID)[$Basement$,$Heating$]
button(LightID)[LIGHT]$All Lights$ none pbutton(PlugID)[LIGHT]$Sockets$
// Page 2
page(BedroomPageID)[$2nd floor$,$Bedroom$]
button(LightID)[LIGHT]$All Lights$ none pbutton(PlugID)[LIGHT]$Sockets$
[EibPC]
CentralHeatingRoomPageID=1
BedroomPageID=2
LightID=1
PlugID=1
if '1/2/4'b01 then display(LightID,$ON$,LIGHT,ACTIVE,BLINKBLUE) else \\
display(LightID,$OFF$,LIGHT,INACTIVE,GREY) endif
if '1/2/5'b01 then display(PlugID,$ON$,LIGHT,ACTIVE,BLINKBLUE,CentralHeatingRoomPageID) else \\
display(PlugID,$OFF$,LIGHT,INACTIVE,GREY,CentralHeatingRoomPageID) endif
if button(LightID)==1 then write('1/2/4'b01, OFF) endif
if pbutton(PlugID,CentralHeatingRoomPageID)==1 then write('1/2/5'b01,OFF) endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]