LogicMachine Forum
ModBus IP / RTU error com - Printable Version

+- LogicMachine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: ModBus IP / RTU error com (/showthread.php?tid=6226)



ModBus IP / RTU error com - Gadjoken - 18.12.2025

Hello everyone,
I have several air handling units connected behind an RS485-to-IP module, using the Modbus RTU protocol. As a result, there are no communication errors with the IP module itself; however, communication errors may occur on the air handling units connected downstream.
For example, if one air handling unit experiences a communication fault, this is correctly recorded in the error log within the Modbus tab. I would like to know whether there is a way to propagate or retrieve this error in order to trigger an email notification.
Best regards.


RE: ModBus IP / RTU error com - admin - 19.12.2025

Use a scheduled script:
Code:
key = 'modbus_error_time'
time = storage.get(key, 0)

items = db:getall([[
  SELECT *
  FROM modbus_errors
  WHERE errortime>?
  ORDER BY errortime
]], time)

if #items == 0 then
  return
end

texts = {}

for _, item in ipairs(items) do
  time = item.errortime
  date = os.date('%c', time)
  texts[ #texts + 1 ] = date .. ' - ' .. item.errortext
end

message = table.concat(texts, '\n')
mail('user@example.com', 'Modbus errors', message)

storage.set(key, time)



RE: ModBus IP / RTU error com - Gadjoken - 19.12.2025

Perfect as usual
B.R.