Commands and functions
P.
232 of 349
Example: monitoring actuator
It checks whether from a KNX device at least 120 minutes a telegram arrives.
In addition, a few statistics about the bus.
Implementation in the user program:
// ---------------------------------------
// physica
l device address
// ---------------------------------------
Raw_Dev=1.1.60
// evaluation
// ---------------------------------------
// max time between two telegrams from one device since recording
Raw_MaxTime=0u16
// min time between two telegrams from one device since recording
Raw_MinTime=65365u16
// last determined time
Raw_CalcTime=0u16
// Average value over all telegrams of the same equipment
Raw_AvgTime=0u64
// errortime: When an error is to be recognized
Raw_TimeWatch=120u64*60000u64
// arguments from readrawknx:
Raw_Kontroll=0
Raw_Sender=0.0.0
Raw_GA=0u16
Raw_IsGa=AUS
Raw_RoutingCnt=0
Raw_Len=0
Raw_Data=$$
// ---------------------------------------
// assistant variables
Raw_AvgTrigger=0u64
Raw_Error=AUS
Raw_AvgTimeSum=0u64
// timescale: 1000 accuracy in seconds
// 60000 accuracy in minutes
Raw_TimeScale=1000u64
Raw_Time=Raw_TimeWatch
// Respond only to group messages on the EibPC and only if the sender address is correct
if event(readrawknx(Raw_Kontroll,Raw_Sender,Raw_GA,Raw_IsGa,Raw_RoutingCnt,Raw_Len,Raw_Data))
and Raw_Sender==Raw_Dev and Raw_IsGa then {
// change time to seconds and calculate min and max values
// evaluate Raw_Time
Raw_CalcTime=convert((Raw_TimeWatch-Raw_Time)/Raw_TimeScale,0u16);
if Raw_MaxTime<Raw_CalcTime then Raw_MaxTime=Raw_CalcTime endif;
if Raw_MinTime>Raw_CalcTime then Raw_MinTime=Raw_CalcTime endif;
// avarage=Raw_AvgTime/Raw_Trigger
Raw_AvgTimeSum=Raw_Avgconvert(Raw_CalcTime,0u64);
Raw_AvgTrigger=Raw_Avg1u64;
Raw_AvgTime=Raw_AvgTimeSum/Raw_AvgTrigger;
} endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]