This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus communication error
#6
Thumbs Up 
missed the post. It does work fine.

i used for loop as i have 36 devices


Code:
offline_time = 600 --offline detection time in seconds

-- for i = START, STOP, STEP
for i = 1, 36, 1 do
 address = ('13/1/'..i)
 obj = grp.find(address)
 delta = os.time() - obj.updatetime
 address = ('13/0/'..i)
 if (delta > offline_time) then
   grp.update(address, false)
 else
   grp.update(address, true)
 end
end
Reply


Messages In This Thread
Modbus communication error - by Mirco - 23.11.2016, 07:33
RE: Modbus communication error - by admin - 23.11.2016, 08:01
RE: Modbus communication error - by Mirco - 18.05.2017, 07:38
RE: Modbus communication error - by Mirco - 24.11.2016, 07:26
RE: Modbus communication error - by admin - 24.11.2016, 07:51
RE: Modbus communication error - by Mirco - 24.11.2016, 08:17
RE: Modbus communication error - by automatikas - 24.01.2017, 13:00
RE: Modbus communication error - by admin - 18.05.2017, 09:34

Forum Jump: