Logic Machine Forum
Modbus read upper/lower word - 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 read upper/lower word (/showthread.php?tid=922)



Modbus read upper/lower word - gtsamis - 01.08.2017

Hi,

I have a modbus power meter and i don't know how to read 2 modbus registers into one bus address?
The manual says address 26 is the upper word and 27 is the lower, is there any way to "combine" them to one?

Thank you in advance


RE: Modbus read upper/lower word - admin - 01.08.2017

Are you using profile or scripts? For profiles you have to set datatype field to "uint32", otherwise use mb:readregistervalue(0x1A, "uint32", "w"). You might also need to adjust read_swap parameter. Start with reading the value from RTU read test in modbus tab.


RE: Modbus read upper/lower word - gtsamis - 02.08.2017

Thank you admin, it worked with read_swap set to 'n' althought on the web interface of the device i get a decimal number on the lm i only get the integer part, but i guess that has to do with the device and not the profile because register 0x1B is always 0