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 - Phnix
#6
This error is usually caused by an issue on the physical communication level.

Disable RTU in Modbus settings and run this script once. Post what you get in Logs. Change device address (1) as needed.
Code:
require('luamodbus')
mb = luamodbus.rtu()

mb:open('/dev/RS485-1', 9600, 'N', 8, 1, 'H')
mb:connect()

buffer = {}

mb:setdebug(function(msg)
  buffer[ #buffer + 1 ] = msg
end)

mb:setslave(1)

res, err = mb:writemultipleregisters(28302, 0)
log(res, err)

mb:close()

log(table.concat(buffer))
Reply


Messages In This Thread
Modbus - Phnix - by balatis - 14.11.2024, 18:29
RE: Modbus - Phnix - by Daniel - 15.11.2024, 08:54
RE: Modbus - Phnix - by balatis - 15.11.2024, 09:02
RE: Modbus - Phnix - by admin - 15.11.2024, 09:02
RE: Modbus - Phnix - by balatis - 15.11.2024, 09:05
RE: Modbus - Phnix - by admin - 15.11.2024, 09:13
RE: Modbus - Phnix - by balatis - 15.11.2024, 09:18
RE: Modbus - Phnix - by admin - 15.11.2024, 09:25
RE: Modbus - Phnix - by balatis - 16.11.2024, 18:11

Forum Jump: