(28.02.2023, 07:02)admin Wrote: You can have up to 65536 registers.
can we test the exported point with LM5?
with the read test !
(06.03.2023, 14:11)Fahd Wrote:(28.02.2023, 07:02)admin Wrote: You can have up to 65536 registers.
can we test the exported point with LM5?
with the read test !
Trying to make a reading test with Modbus Poll program and the values do not change at all, please see attached.
this is the resident script that I'm using
Code:
local mb = require('user.mbtcp')
local copas = require('copas')
local socket = require('socket')
local address = '*'
local port = 502
local server = assert(socket.bind(address, port))
mb.setmapping({
['1'] = {
coils = {
[0] = '0/0/1',
[1] = '0/0/2',
[2] = '0/0/3',
[4] = '0/0/4',
},
registers = {
[0] = '1/1/4',
[5] = '1/1/6',
}
}
})
mb.setswap('w')
local function handler(sock)
copas.setErrorHandler(log)
sock:settimeout(60)
while true do
local res, err = mb.tcphandler(sock)
if not res then
break
end
end
sock:close()
end
copas.addserver(server, handler, 60)
copas.loop()