24.11.2020, 13:48
I have a strange modbus problem when I try to control an Alpitronic Hypercharger.
Holding Register 1600 and 1601 containing an unit32 value which can be written via my PC (QModMaster) but when I try to write it with a script:
require('luamodbus')
local mb = luamodbus.tcp()
mb:open("192.168.80.219", 502)
mbetslave(255)
mb:connect()
log(mb:writeregistervalue(1600, 50000, "uint32"))
mb:close()
The charger ignors the command and in the script log I get a 2 as return value.
On working communication I get a 1 back.
What's the meaning of 2? I can't find any documentation.
I also tried mb:writeregisters(1600, 0, 50000) and writemultibleregisters, no difference.
Thank's
Christian
Holding Register 1600 and 1601 containing an unit32 value which can be written via my PC (QModMaster) but when I try to write it with a script:
require('luamodbus')
local mb = luamodbus.tcp()
mb:open("192.168.80.219", 502)
mbetslave(255)
mb:connect()
log(mb:writeregistervalue(1600, 50000, "uint32"))
mb:close()
The charger ignors the command and in the script log I get a 2 as return value.
On working communication I get a 1 back.
What's the meaning of 2? I can't find any documentation.
I also tried mb:writeregisters(1600, 0, 50000) and writemultibleregisters, no difference.
Thank's
Christian