This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

MODBUS
#7
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
mb3Confusedetslave(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?
Reply


Messages In This Thread
MODBUS - by KARRAS - 16.01.2024, 08:48
RE: MODBUS - by Daniel - 16.01.2024, 08:54
RE: MODBUS - by KARRAS - 16.01.2024, 09:56
RE: MODBUS - by admin - 16.01.2024, 09:58
RE: MODBUS - by KARRAS - 16.01.2024, 10:12
RE: MODBUS - by Daniel - 16.01.2024, 10:18
RE: MODBUS - by KARRAS - 16.01.2024, 10:59

Forum Jump: