11.09.2020, 09:33
(11.09.2020, 08:40)admin Wrote: Scripts looks ok. How is it set up, as a scheduled script which runs every minute?Was first put in event based. My mistake. Now put into scheduled, but lowest number under minutes seems to be in scheduled script */2, */1 gives error.
It can be written a bit shorter like this, logs might help you to find out why it's not working.
Code:heartbeat_time = 60 -- Minutes
heartbeat_device_object = '32/1/1' -- Change address to your heartbeat device
heartbeat_alarm_object = '32/1/2' -- Change address to a alarm address
obj = grp.find(heartbeat_device_object)
if obj then
delta = os.time() - obj.updatetime
alarm = delta >= heartbeat_time * 60
log(delta, alarm)
grp.checkwrite(heartbeat_alarm_object, alarm)
end
It change into alarm. But booleon values written into the heartbeat device dont seem to change the alarm. It just continues to say "True".
Device writes cyclical every 30 sec. And i changed the script down to 1 minutes and the multiplier down to * 1.
Maybe this is to tight.
Log shows this.: