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 mapping help
#7
Disable RTU1 in Modbus settings, then run this script. It will run for a couple of minutes and will log any found devices.

Code:
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485-1', 9600, 'N', 8, 1, 'H')
mb:connect()

for i = 1, 247 do
  mb:setslave(i)
  res, err = mb:readregisters(0)

  if res ~= nil then
    log('found device', i, res)
  end
end

mb:close()
Reply


Messages In This Thread
Modbus mapping help - by sunhailun - 15.12.2025, 00:39
RE: Modbus mapping help - by admin - 15.12.2025, 07:43
RE: Modbus mapping help - by sunhailun - 15.12.2025, 10:20
RE: Modbus mapping help - by sunhailun - 16.12.2025, 15:19
RE: Modbus mapping help - by Daniel - 16.12.2025, 15:21
RE: Modbus mapping help - by sunhailun - 17.12.2025, 03:00
RE: Modbus mapping help - by admin - 17.12.2025, 08:10
RE: Modbus mapping help - by sunhailun - 17.12.2025, 13:26
RE: Modbus mapping help - by Daniel - 17.12.2025, 08:35
RE: Modbus mapping help - by Daniel - 17.12.2025, 13:27
RE: Modbus mapping help - by sunhailun - 17.12.2025, 13:34
RE: Modbus mapping help - by Daniel - 17.12.2025, 13:36
RE: Modbus mapping help - by sunhailun - 17.12.2025, 13:38
RE: Modbus mapping help - by Daniel - 17.12.2025, 13:46
RE: Modbus mapping help - by sunhailun - 17.12.2025, 13:59
RE: Modbus mapping help - by Daniel - 17.12.2025, 14:01
RE: Modbus mapping help - by sunhailun - 17.12.2025, 14:08
RE: Modbus mapping help - by Daniel - 17.12.2025, 14:08
RE: Modbus mapping help - by sunhailun - 17.12.2025, 14:15
RE: Modbus mapping help - by Daniel - 17.12.2025, 14:17
RE: Modbus mapping help - by sunhailun - 17.12.2025, 14:19
RE: Modbus mapping help - by sunhailun - 19.12.2025, 13:14
RE: Modbus mapping help - by Daniel - 19.12.2025, 13:17
RE: Modbus mapping help - by sunhailun - 19.12.2025, 13:25

Forum Jump: