02.03.2025, 19:06
(This post was last modified: 02.03.2025, 19:07 by EjvindHald.)
(25.02.2025, 07:19)admin Wrote: You can use binary input mode and event script to measure the time between each ON telegram.
Code:value = event.getvalue()
if not value then
return
end
tsec, tusec = os.microtime()
time = tsec + tusec / 1000000
key = 'on_time'
out = '1/1/2'
delta = time - storage.get(key, 0)
log(delta)
if delta < 0.4 then
grp.checkwrite(out, false)
elseif delta < 0.8 then
grp.checkwrite(out, true)
end
storage.set(key, time)
Thanks - this is much appreciated. I assume that usage of the storage function will only have minor impact on wear and tear of the SD Card? Is your suggestion a resident or event-based script?
Besides the need for my gate, I also have another use case which have a higher frequency, so it will be directly connected to the local i/o ports to reduce the traffic on the bus. I found the frequency option, but I could find any description of it. Can you provide a link or similar with a description? Also here I need to test towards a given threashold within a time period. See screenshot.
Thanks
