05.11.2019, 12:52
(30.10.2019, 13:26)admin Wrote: The same way as ModBus RTU - create a profile and assign it to a device.Hi,
Thank you very much, now I want to know how the script would be, because for example in modbus RTU one creates a script with the following code:
Code:
-- init modbus on first script execution
if not mb then
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/ttyS2', 9600, 'E', 8, 1, 'H')
mb:connect()
end
-- sets slave ID to read/write data from/to
mb:setslave(20)
-- read 3-phase system voltage from 32-bit register
r1, r2 = mb:readregisters(0x1000, 2)
result = bit.lshift(r1, 16) + r2
grp.write('5/5/1',result)
for the Modbus IP would I have to change something?
thank you very much