Programming - First steps
P.
52 of 349
A staircase lighting
Two variants:
Re-trigger or not?
Variant 1: No Re-triggering
Definition of a KNX
TM
string
$ Text$c14
New
event(Group address)
after(Term, Time in ms)
convert(Source, Target)
Example 5: A staircase lighting
Figure 14 is the installation, for which a stairwell light (3 min switching time) is to be realized. The
switch always returns one ON pulse (thus, it will no longer be turned off) only.
On a display element, you also want to view how often the button was pressed. You have defined the
group address 1/2/2 within the ETS for the display element as a string with a maximum of 14
characters.
E ib PC
Eib PC
RS 232
Switch
'1/0/0'
Lamp - binary
'1/1/1'
KNX Display
'1/2/2'
KNX Bus
Figure 14: Staircase lighting
At system start, the light shall go out. The switch alternately provides ON and OFF telegrams.
After pressing the switch (“switch position“ should be arbitrary), the light shall turn on and
automatically turn off again after three minutes. The sum of the switching processes already
made will be shown on KNX display element.
Variation 1
: At re-pressing the switch during the 3 minutes turn-on time, the timer switch shall
not restart.
Variation 2
: At re-pressing the switch during the 3 minutes turn-on time, the timer switch shall
restart.
First, we show the realization of
Variant 1
. This time without the use of imported group addresses.
In this realization, the timer will not restart, if it is already running (no "re-triggering"). First, the
program:
[EibPC]
if systemstart() then write('1/1/1'b01,OFF) endif
SwitchingOperation=OFF
Counter=0u32
EmptyString=$ Nothing yet! $c14
if event('1/0/0'b01) and (SwitchingOperation==OFF) then \\
SwitchingOperation=ON; \\
write('1/1/1'b01,ON); \\
Counter=1u32\\
endif
if (after( SwitchingOperation==ON, 180000u64)) then
\\
write('1/1/1'b01,AUS);
\\
SwitchingOperation=OFF;
\\
write('1/2/2'c14,convert(Counter,EmptyString)) \\
endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]