13.03.2023, 16:07
(13.03.2023, 16:00)Daniel Wrote: Your master must send write command for value to be updated.
The modbus master is a Siemens PLC and it is cyclically writing to these registers.
I can communicate using the attached script but the CPU usage increases a lot and I have to communicate with multiple PLCs.
Code:
require('luamodbus')
mb = luamodbus.tcp()
mb:open('192.168.2.108', 503)
mb:connect()
mb:setslave(3)
local value_1 = mb:readregisters(2104)
if value_1 then
grp.update('32/5/4', value_1)