Programming - First steps
P.
63 of 349
Saving scenes
Calling scenes
Preconfigure a scene
Scenes without scene button
Short for (see page 153)
Keypress=0u08
Scene=1u08
Evaluate after one second
evaluating,
whether switched once or twice.
You can use the
scene
function almost arbitrary times (max. 65,000), e.g. for two actuators:
[EibPC]
scene('1/0/0'u08, "Lamp-1/1/1“, "'Dimmer-1/2/2")
scene('2/0/0'u08, "Lamp-1/1/1“, '1/3/2'u08, '5/8/8'f32, '4/4/56's16)
The Enertex
®
EibPC itself can also address scenes and initiate their storage.
There are two functions
storescene(
GroupAddresseSceneBlock
,
SceneNumber{u08})
callscene(
GroupAddresseSceneBlock, SceneNumber{u08})
The first function assigns a scene block (KNX device or
scene
function of the Enertex
®
EibPC) to
save the scene with the
SceneNumber
. The second function initiates a retrieval, i.e. the scene is
recalled. The scene block is activated via the group address.
Instead of the number you can also use variables, as will be shown in the next example. The group
address of the scene actuator may relate to a scene actuator in Enertex
®
EibPC (i.e.
scene
function)
as well as to an external scene module.
presetscene
can be used to pre-configure a scene (p.217).
Finally, a small “goody“:
Suppose, the switch of your KNX™ network (Figure 22) can only supply binary messages: You have
programmed your system so that the OFF telegram already switches off all lights. Now, when you
press ON, the scene with number 1 is to be called, i.e. a bit is now only sent to group address 1/0/0.
But you want even more:
If you press
ON
for a second time within the first second, the scene will be saved. You realize the
“double click“ as you are accustomed from your use of the PC and mouse.
No problem:
[EibPC]
// The Scene actuator
scene('1/2/3'u08, "Lamp-1/1/1", "Dimmer-1/2/2"u08)
// Variable
Keypress=0
Scene =1
// Counter of keypress
if (("Switch-1/0/0") and event("Switch-1/0/0")) then Keypress= K1 endif
// Reset of counter
if (after(event("Switch-1/0/0"),1000u64) then Keypress=0 endif
// Saving or calling
if after(event('1/0/0'b01),1000u64) and (Keypress ==1) then callscene('1/2/3'u08,Scene) endif
if (after(event('1/0/0'b01),1000u64) and (Keypress ==2) then storescene('1/2/3'u08,Scene) endif
But not enough:
In the library Enertex.lib, you will find a ready function block “Doubleclick()“ for the double occupancy
of buttons.
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]