Programming - First steps
P.
41 of 349
Initialization of many group
addresses
Now we can extend the program further, so that the actuators are switched off in any case. It could
be that the switch is still
ON
.
Then a read request should query the state of the switch and the lights are switched accordingly.
[ETS-ESF]
/EibPc/Haus.esf
[EibPC]
if (systemstart()) then
\\
read("Switch-1/0/0") ; \\
write("Lamp-1/1/1",OFF);
\\
write("Dimmer-1/1/2"u08,0%) \\
endif
if ("Switch-1/0/0"==ON) then
\\
write("Lamp-1/1/1",ON);
\\
write("Dimmer-1/1/2"u08,80%) \\
else
write("Lamp-1/1/1",OFF);
\\
write("Dimmer-1/1/2"u08,0%) \\
endif
Also this program must be transferred to the EibPC.
If you need to read more group addresses you can use the [
InitGA
] section as described at p. 166. In
this case, the reads of the group addresses in this section have been read before the program is
processed.
[ETS-ESF]
/EibPc/Haus.esf
[InitGA]
"Switch-1/0/0"
[EibPC]
if (systemstart()) then {
write("Lamp-1/1/1",OFF);
write("Dimmer-1/1/2"u08,0%)
} endif
if ("Switch-1/0/0"==ON) then {
write("Lamp-1/1/1",ON);
write("Dimmer-1/1/2"u08,80%)
} else {
write("Lamp-1/1/1",OFF);
write("Dimmer-1/1/2"u08,0%)
} endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]