Logic Machine Forum
Writing to Modbus - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Writing to Modbus (/showthread.php?tid=4838)



Writing to Modbus - Amelie - 21.06.2023

Hello,

I'm trying to write to the Modbus of my Nine heatpump. I have the script:

Code:
require('luamodbus')
mb = luamodbus.tcp()
mb:open('192.168.1.65', 502)
mb:connect()
mb:writeregisters(1078, 1)
mb:close()

The code is not tested yet, so there are probable faults in.

But, now I realised, that when I looked to the modbus, there are 2 registers withe the number 1078, a holdingregister and an inputregister.
Code:
Titel                    Type register            Register
Status meer warmwater    MODBUS_INPUT_REGISTER    1078
Ontdooitijd (FLM 3)    MODBUS_HOLDING_REGISTER    1078

How can I make sure that I write to the correct register.?


RE: Writing to Modbus - admin - 21.06.2023

Input registers and holding registers are different entities so they can have the same address. Only holding registers are writable, input registers are read-only.