Logic Machine Forum
Modbus RTU - Function 16 (write multiple holding registers) - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Modbus RTU - Function 16 (write multiple holding registers) (/showthread.php?tid=30)



Modbus RTU - Function 16 (write multiple holding registers) - Pawel - 10.07.2015

Hi,
I have problem with modbus rtu integration with NIBE Heat pump. I have established connection via modbus rtu with modbus 40 extension of this heat pump. Reading working properly, but if i want to write some registers, i have to use write multiple holding registers (function 16), despite of fact that I write only one register.

If I use mb:writeregisters function there is no possibility to choose 06 function or 16 function, but i have to have 16 function to proper write command 

using 
Code:
mb:writeregisters (registers, value, nil)

doesn't work.

Do you have any idea how do that? Maybe using mapping of modbus registers resolve problem?


RE: Modbus RTU - Function 16 (write multiple holding registers) - admin - 10.07.2015

Try this, it will force using command 16 instead of 06 even when writing to a single register:

Code:
mb:writemultipleregisters(register, value)



RE: Modbus RTU - Function 16 (write multiple holding registers) - Pawel - 10.07.2015

Nice,

Thanks you. Smile