You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self._mb.write_register is used. But this writes only one address at once, which is only valid for devices expecting 16 bit values. Devices with values like int32 or int64 expect writing all relevant addresses at once and not in sequence. Hence self._mb.write_registers (plural) is required. Sure, this might require code changes at many other positions.
The text was updated successfully, but these errors were encountered:
This issue also just occured to me. My heating unit provides only int32 registers and I can perfectly read everything and publish to MQTT - but the way back does not work. When using the pymodbus.console-application and calling write_registers as you proposed, I can set new values, so I assume that is the same issue.
You can get round this issue by converting your two 32 bit into two 16 bits. These two 16 bits are not the values you would expect but have to be converted in a special way. I don't fully understand how it works but if you play around on this website with conversions from 16bit to 32 bit and then back again it may become clearer to you.
What you must understand is that your modbus server does not have any 32 bit registers, it just has 2 concurrent 16 bit registers that when jointly read can be processed and converted to a 32 bit register but all this happens outside the server. So to write backwards you also need to reverse this conversion.
In
modbus4mqtt/modbus4mqtt/modbus_interface.py
Line 149 in d563879
The text was updated successfully, but these errors were encountered: