Programming - First steps
P.
96 of 349
In order for the shifter to perform the desired effect, which means to turn off all lights on the floor, our
shifter must be assigned with a finished macro. The macro can be found under the following name:
UmschaltShifterAUSGlobal
[
Macros
]
UmschaltShifterAUSGlobal(MainSwitchGroundFloor,"EGallLights-0/5/1",EGAllLights,LIGHT)
If the macro is integrated, all the lights on the desired floor will turn off and the shifter's icon display
will change from red to gray with green status fonts.
This procedure is carried out with new variables as well for the window contacts. The difference to
the lights consists in the execution as local and in the functionality of the shifters. If you do not have
windows which can be closed by a servomotor, the inclusion of a macro at the end is no longer
necessary. The shifter thus serves only as a display.
[
EibPC
]
//// Declarations
//Variables
EG_WindowOpen = 0b01
////Functions
//Ground floor window
if "3WindowContact-4/1/0" or"Constr5WindowContact-4/1/2" or "K8WindowContact-
4/1/4" or "WCLadies10WindowContact-4/1/6" or "Lab1WindowContact-4/1/7" or "9WindowContact-
4/1/8" then EG_Window
Open
= 1b01 endif
/// pdisplay window local variables
//EG
if EG_WindowOpen then pdisplay(10,$Ground floor - Window
open$,WINDOW,BRIGHTRED,BLINKRED,StatusID) else pdisplay(10,$Window
close$,WINDOW,INACTIVE,GREY,StatusID) endif
In order to be able to switch all floors or the complete main building, a group address must be
created in the ETS, which switches all desired lamps. This is then inserted into the macro
ShiftShifterAUSLocal
. Now you can switch the building with one click. To adjust the icon we use
pdisplay
and represent it depending on the condition.
[
EibPC
]
//// Declarations
//Variables
AllLightsHG = 0b01
////Functions
/// pdisplay Lights local variables
//Main switch
if
AllLightsHG
== ON then pdisplay(20,$Lights are
ON$,SWITCH,BRIGHTRED,BLINKRED,StatusID) else pdisplay(20, $Lights are
OFF$,SWITCH,INACTIVE,GREEN,StatusID)endif
In order to make sure that the status of lamps and windows is OK, we are linking the variables of the
individual floors (EgAllLights, EG_WindowOpen, ...) with a new status variable StatusHG
[
EibPC
]
//Variablen
StatusHG = 0b01
// if-Status
if ( Stairs == ON or OGAllLights== ON or EGAlleLichter == ON or KGAllLights == ON or EG_WindowOpen ==
ON or KG_WindowOpen ==ON or OG_WindowOpen == ON ) then StatusHG = ON else StatusHG = OFF
endif
if StatusHG == ON then pdisplay(5,$Status
monitoring$,CROSSCIRCLE,BRIGHTRED,BLINKRED,GeneralWeatherPageID) endif
if StatusHG == OFF then pdisplay(3,$Status OK$,OKCIRCLE,ACTIVE,GREEN,GeneralWeatherPageID)
endif
If this is also done for the secondary building, we will have the following representation on our main
page, each with a luminous lamp of the two buildings:
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]