Programming - First steps
P.
48 of 349
Time control
Motion detector
Thus our application program is:
[ETS-ESF]
// The exported ESF-Data from the ets
EibPC/Haus.esf
[EibPC]
if (systemstart()) then
\\
MotionDetector=AUS; \\
read("Switch-1/0/0") ; \\
write("Lamp-1/1/1",AUS); \\
write("Dimmer-1/1/2"u08,0%) \\
endif
// Variables
Switch="Switch-1/0/0"
MotionDetector=“MotionDetector-1/2/0“
Dimmer=100%
// The switch
if (Switch==ON) then \\
write("Lamp-1/1/1",EIN); \\
write("Dimmer-1/1/1",EIN); \\
write("DimmerValue-1/1/2",100%) \\
endif
if (Switch==OFF) then \\
write("Lamp-1/1/1",AUS); \\
write("Dimmer-1/1/2"u08,0%) \\
endif
// Motion detector
if (htime(20,00,00)) and (Switch==OFF) then Dimmer=50% endif
if (htime(23,00,00)) and (Switch==OFF) then Dimmer=30% endif
if (htime(03,00,00)) and (Switch==OFF) then Dimmer=10% endif
if (htime(07,30,00)) and (Switch==OFF) then Dimmer=100% endif
if (MotionDetector==EIN) and (Switch==OFF) then write("Dimmer-1/1/1",EIN); write("DimmerValue-1/1/2",Dimmer) endif
if (MotionDetector==AUS) and (Switch==OFF) then write("Dimmer-1/1/1",AUS) endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]