Programming - First steps
P.
95 of 349
[
Web server
]
//Web elements for Status main building
page(StatusID)[$General$,$Status main building$]
design $black$
header(0)
footer(0)
// First Line
plink(5)[RIGHT][FirstFloorID]$To First floor – Page$
none
shifter(MainSwitchFirstFloor)[LIGHT]$First floor turn off all lights$
pshifter(11)[WINDOW]$Window First floor$
// Second Line
plink(6)[RIGHT][GroundFloorID]$To Ground floor-Page$
none
shifter(MainSwitchGroundFloor)[LIGHT]$Ground floor turn off all lights$
pshifter(10)[WINDOW]$Window Ground floor$
// Third Line
plink(7)[RIGHT][BasementID]$To basement – Page$
none shifter(MainSwitchBasement)[LIGHT]$Basement turn off all lights$ pshifter(9)[WINDOW]$Window
basement$
// Fourth Line
plink(15)[RIGHT][StaircaseID]$To staircase-Page$
none
shifter(MainSwitchStaircase)[SWITCH]$Staircase turn off all lights$
pshifter(31)[WINDOW]$Window Cellar staircase$
//Fifth Line
shifter(ClockID)[CLOCK] $Time$
pshifter(20)[SWITCH]$Turn off all lights$
shifter(DateID)[DATE]$Date$
[
EibPC
]
//// Declarations
// Initialization of the PageIDs for the visualization wizard
GeneralWeatherPageID = 1
//Initialization of the web element IDs
WINDID = 1
WolkenID = 2
ClockID = 3
DateID = 4
MainSwitchGroundFloor = 5
To the function of the floor switches:
In principle, each floor switch consists of a variable which can be true or false (type b01). The
variable is written by the status group addresses of the lamps and is true as soon as a light is on in a
room. For example:
If (Status_Room1 == OFF or Status_Room2 == OFF or Status_Room 3 == OFF) then the
variable Licht_Erdgeschoss should be set to ON, otherwise set to ON.
In the EibStudio, this is then implemented for all desired floors as follows:
[
EibPC
]
//// Declarations
//Variables
EGAllLights = 0b01
//// Functions
//Ground floor all lights
if("Lab_1_Status-0/1/18" == OFF and "Office_2_Status-0/1/19" == OFF and "Construction_3_Status-0/1/20"
== OFF and "Construction_4_Status-0/1/21" == OFF and "Floor_5_Status-0/1/22" == OFF and
"Kitchen_6_Status-0/1/23" == OFF and "Kitchen_7_Status-0/1/24" == OFF and "Storeroom 8_Status-0/1/25"
== OFF and "WCLadies_9_Status-0/1/26" == OFF) then
EGAllLights
= OFF else
EGAllLights
= ON endif
So in our web server the display also fits to the value of the variable, we adjust our shifter using the
function
webdisplay
(ID, Text, Icon, State, TextStyle, [Mbutton])
.
[
EibPC
]
////Functions
/// Web display Lights global Variables
// EG
if EGAllLights == ON then web display (MainSwitchGroundFloor,$On the ground floor lamps light
up$,LIGHT,BRIGHTRED,BLINKRED) else web display(MainSwitchGroundFloor,$There are no lamps on the
ground floor$,LIGHT,INACTIVE,GREEN) endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]