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
Writing Negative Values with write_multiple_registers in Modbus INT16 for SOFAR HYD 20K 3PH
Hi everyone,
I’ve been using this repo to write positive values to my SOFAR HYD 20K 3PH inverter, which allows me to charge my battery on demand, utilizing either grid power or solar production, depending on availability. However, I’ve hit a roadblock when trying to discharge my battery.
The issue seems to stem from the way Modbus handles values, specifically the INT16 format, as described in this GitHub issue. My understanding is that INT16 limits the register values to represent signed integers, which makes writing negative values a challenge.
I’m curious if anyone else in the community has encountered this problem. If so, have you managed to find a workaround for writing negative values via write_multiple_registers? Any insights, solutions, or even just confirmation that this is a shared issue would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Writing Negative Values with
write_multiple_registers
in Modbus INT16 for SOFAR HYD 20K 3PHHi everyone,
I’ve been using this repo to write positive values to my SOFAR HYD 20K 3PH inverter, which allows me to charge my battery on demand, utilizing either grid power or solar production, depending on availability. However, I’ve hit a roadblock when trying to discharge my battery.
The issue seems to stem from the way Modbus handles values, specifically the
INT16
format, as described in this GitHub issue. My understanding is thatINT16
limits the register values to represent signed integers, which makes writing negative values a challenge.I’m curious if anyone else in the community has encountered this problem. If so, have you managed to find a workaround for writing negative values via
write_multiple_registers
? Any insights, solutions, or even just confirmation that this is a shared issue would be greatly appreciated!Looking forward to hearing your thoughts.
Beta Was this translation helpful? Give feedback.
All reactions