Programming for experts
P.
105 of 349
Raw information from the bus
Identy group addresses
For each group address that is to be
recorded an if-query
Determination of sending group address
For this task you need the function
readrawknx
:
readrawknx
(
Sim_Control {u08}, Sim_Sender{u08}, Sim_GA{u08},
Sim_IsGA{b01},
Sim_RoutingCnt {u08}, Sim_Len{u08}, Sim_Data{c1400}
)
If any KNX telegram is observed on the bus the function readrawknx updated its arguments. In this
case the arguments of the function are “filled” with data. The received user data are then copied to
the argument
Sim_Data ,
the amount of data (bit length) can be queried with the variable
Sim_Len .
Upon receipt of a telegram the argument
Sim_IsGA
is set accordingly, i.e. is it an ordinary group
telegram so this argument is set by
readrawknx
to ON and
Sim_GA
contains the address itself. The
function
readrawknx
can be linked to
event
in order to process the arrival of a telegram
With the selected definitions
Sim_GA=0u16
Sim_IsGa=OFF
Sim_RoutingCnt=0
Sim_Len=0
Sim_Data=$$c4000
Recorder=$$c4000
Timestamp=$$c4000
you can now process the arrival of a telegram as follows:
if event(readrawknx(Sim_Kontroll,Sim_Sender,Sim_GA,Sim_IsGa,Sim_RoutingCnt,Sim_Len,Sim_Data)) then ....
It should be noted that the group address
Sim_GA
is calculated as 16-bit value. In order to compare
this address with the usual spelling is the function
getaddress
at your disposal. In the following
example
MeinGA=getaddress("Licht-1/2/3")
there is now MeinGA the 16-bit value which represents the group address and how this is also
copied
Sim_GA.
Now it is determined out of which group address the arrived telegram has been
sent.
With the help of variables
Sim_GA=OFF
should the recording of an incoming message be triggered as follows. For each recorded group
address are if-queries deposited.
Sim_GA
is determined as above mentioned by
readrawknx
.
Code-part 1
if Sim_GA==getaddress("Heizvorlauf-0/0/1") then Sim_MyGA=ON else Sim_MyGA=OFF endif
if Sim_GA==getaddress("Temperatur-3/5/0") then Sim_MyGA=ON else Sim_MyGA=OFF endif
if Sim_GA==getaddress("Licht-1/0/29"u16) then Sim_MyGA=ON else Sim_MyGA=OFF endif
The both modes Record/Play are realised via
Sim_Play=OFF
At
Sim_Play
= ON the existing recording should be played and at OFF the recording should be
started.
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]