Programming for experts
P.
103 of 349
Timer
termination conditions=>
Queue
Command Fusion
Presence state machine
With this a timer can now be stopped if there is no longer need for e.g. the end of the process and
the associated action of the
if
-statement.
MyTrigger=OFF
remainingtime1=0u64
if afterc(MyTrigger,10000u64, remainingtime1) then {
write('1/2/3'c14,$Timer1$c14)
} endif
if MyTrigger== OFF then remainingtime1=0u64 endif
If in the example
MyTrigger
switches to ON the timer is started, if
MyTrigger
switches to OFF before
the expiry of the time, the timer is stopped by setting
remainingtime1=0u64 .
The
then
-branch is not
executed.
If you want to stop the timer before but running the
then
-branch it must
RestZeit1=1u64
be set. In
this case the execution is performed in the next processing cycle.
The event-based processing in EibPC requires the programming of socalled “state machine”. The
(abstract) basic principle of a “state machine” is that programming is not performed sequentially but
that the software assumes a certain state depending on events.
When exchanging data with another device e.g. via TCP/IP telegrams, you can define the following
states:
1.
Receive data from the other participants
2.
Send data to the other participants
3.
Cache data of the other participants
4.
Evaluate the data of the other participants
5.
Perform various KNX actions on the bus
Each of these conditions is at least in principle independently of the other i.e. the EibPC has to
accept data while e.g. KNX telegrams arrive. In addition various states can “triggering” each other
respectively the arrival of a KNX telegram encourage the data processing.
On http://knx-user-forum.de/special/Enertex EibPC and Command Fusion is a complete description
of a “state machine” located, which processed a queue.
In the supportforum following request originated. The users want to switch to the macro
At_Sunset_Capped_withRelease
at sunset respectively at the latest at a certain time in a
macro group address.
In the same way the macro is used: At
_Sunset_Capped_withRelease
at sunset.
Bei_Sonnenuntergang_Gedeckelt_mitFreigabe(Sued,FreigabeVar,"Licht Wohnen-
2/2/3",AUS,22060000,22,31,00)
Bei_Sonnenaufgang_Gedeckelt_mitFreigabe(Sonnenaufgang1,FreigabeVar,"Rolläden Ost-
5/2/0",RAUF,7200000,07,28,00)
The macros are parameterized with the release-variable
FreigabeVar
.
For this purpose the release is divided into the following observation periods:
•
Day mode: Sunrise to sunset
•
Early mode: Period after 0:00 clock and before sunrise
•
Late mode: After sunset and not after 0:00 clock
The user presses a group address
"Presence-8/1/1"
(Typ b01, ON==present).
The release-variable
FreigabeVar
should be switched dependent on the following states.
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]