19.09.2022, 06:20
"method called on invalid context" means that the connection is not open or already closed.
Both examples will produce this error:
Both examples will produce this error:
Code:
mb = require('luamodbus').tcp()
mb:open(IP, PORT)
mb:connect()
mb:close()
res, err = mb:readregisters(0)
Code:
mb = require('luamodbus').tcp()
res, err = mb:readregisters(0)