09.09.2024, 09:00
Hi everybody!
I have a problem about modbus writing.
In this work there is two airconditioning connected to modbus and it have the same modbus ID (49). I can't change it because the company don't allow it.
I connected this two device to the two different port of RS485.
But the problem is to open comunication with proxy. You can't specificate where it have to open comunication.
I use this script:
I have a problem about modbus writing.
In this work there is two airconditioning connected to modbus and it have the same modbus ID (49). I can't change it because the company don't allow it.
I connected this two device to the two different port of RS485.
But the problem is to open comunication with proxy. You can't specificate where it have to open comunication.
I use this script:
Code:
-- get value of object with group address 1/1/1
setpoint_z2 = grp.getvalue('1/1/1')
setpoint_z2_mb = setpoint_z2*2
-- proxy works only when RTU is enabled in Modbus settings
mb = require('mbproxy').new()
mb:setslave(49)
-- set register at address 6
mb:writeregisters(6, setpoint_z2_mb)
-- read from address 6
value_rmb = mb:readregisters(6)