Hello,
I also tried with uint16 but it doesn't work, I have tried everything.
Now, I just tried it this way and it works with this script.
-- object mapped to this event must have its data type set
value = event.getvalue()
require('luamodbus')
mb3 = luamodbus.tcp()
IP='192.168.1.141' --IP
mb3:open(IP, 502)
mb3:connect()
address=1 ----DIRECCIÓN DEL DISPOSITIVO ESCLAVO
mb3
etslave(address)
registro=2 --registro modbus
--valueInt1, valueInt2 = mb3:readregisters(registro,1)
--log(valueInt1, valueInt2 )
r1, r2 = mb3:writemultipleregisters(registro, value)
Do you know any way to be able to see the modbus command that comes out through the port, that is, the composition of the writing, to see what it sends through the port?
I also tried with uint16 but it doesn't work, I have tried everything.
Now, I just tried it this way and it works with this script.
-- object mapped to this event must have its data type set
value = event.getvalue()
require('luamodbus')
mb3 = luamodbus.tcp()
IP='192.168.1.141' --IP
mb3:open(IP, 502)
mb3:connect()
address=1 ----DIRECCIÓN DEL DISPOSITIVO ESCLAVO
mb3
![Confused Confused](https://forum.logicmachine.net/images/smilies/confused.png)
registro=2 --registro modbus
--valueInt1, valueInt2 = mb3:readregisters(registro,1)
--log(valueInt1, valueInt2 )
r1, r2 = mb3:writemultipleregisters(registro, value)
Do you know any way to be able to see the modbus command that comes out through the port, that is, the composition of the writing, to see what it sends through the port?