This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Huawei - Input Register not working
#1
I managed to intergrade my Huawei solar inverter and communicate over TCP modbus.
Unfortunately, what I haven't manage to do, is send values to the inverter over register 40120,
which is the one controlling the active power of the inverter.

Attached you can see the profile I created for the inverter and the documentation from the manufacturer.

Attached Files
.pdf   Solar Inverter Modbus Interface Definitions.pdf (Size: 1.3 MB / Downloads: 7)
.json   Huawei_SUN2000-Huawei_Inverters.json (Size: 5.97 KB / Downloads: 3)
Reply
#2
Input registers are read-only. Type must be set to "register" and "writable" flag must be enabled for writing to work.
Reply
#3
I also tried with this configuration, but still no success

Attached Files
.json   Huawei_SUN2000-Huawei_Inverters (1).json (Size: 10.87 KB / Downloads: 8)
Reply
#4
Have you created the device again from scratch after modifying the profile? You should use the Modbus profiler app which allows editing existing devices.
Reply
#5
(07.08.2026, 08:56)admin Wrote: Have you created the device again from scratch after modifying the profile? You should use the Modbus profiler app which allows editing existing devices.

I changed it over the Modbus profiler app.
BTW on my initial configuration I had it as a register and I only changed it after I realized it didn't work properly
Reply
#6
Can you write to any other register?
Reply
#7
(07.08.2026, 09:14)admin Wrote: Can you write to any other register?

I also tried register 40125, but still not working.
The registers are tested over another application and work just fine
Reply
#8
what are the settings when using another application?
------------------------------
Ctrl+F5
Reply
#9
(07.08.2026, 09:40)Daniel Wrote: what are the settings when using another application?

Attached Files Thumbnail(s)
   
Reply
#10
Run this script once and post what you get in LM Logs tab. Change Modbus device IP if needed.

Code:
mb = require('luamodbus').tcp() mb:open('192.168.99.141', 502) res, err = mb:connect() if res then   mb:setslave(2)   res, err = mb:writeregisters(40120, 300)   if res then     log('write ok')   else     log('write failed', err)   end   else   log('connection failed', err) end mb:close()
Reply
#11
(07.08.2026, 11:49)admin Wrote: Run this script once and post what you get in LM Logs tab. Change Modbus device IP if needed.

Code:
mb = require('luamodbus').tcp() mb:open('192.168.99.141', 502) res, err = mb:connect() if res then   mb:setslave(2)   res, err = mb:writeregisters(40120, 300)   if res then     log('write ok')   else     log('write failed', err)   end  else   log('connection failed', err) end mb:close()

I set it to run every 5 seconds and I get these messages

Attached Files Thumbnail(s)
   
Reply
#12
Are you sure that the IP address is correct? Increase the interval to 60 seconds.

You might need to temporarily delete the device from LM Modbus tab to free up a connection. Are you using persistent connection in the device settings?
Reply
#13
(07.08.2026, 11:58)admin Wrote: Are you sure that the IP address is correct? Increase the interval to 60 seconds.

You might need to temporarily delete the device from LM Modbus tab to free up a connection. Are you using persistent connection in the device settings?

IP is correct
Interval changed to 60 seconds, but the messages are still the same
I was not using a persistent connection. I changed it to persistent, but still I get the same messages
Reply
#14
Have you deleted the device before running the script? What do you have in Modbus tab Error log?
Reply
#15
If nothing helps, try rebooting inverter.
------------------------------
Ctrl+F5
Reply
#16
(07.08.2026, 12:19)admin Wrote: Have you deleted the device before running the script? What do you have in Modbus tab Error log?

Deleting is not the optimum idea. You should have a deactivate option instead.


I deleted the device, I still get the same messages and nothing on the errors

Attached Files Thumbnail(s)
   
Reply
#17
Did you reboot inverter?
------------------------------
Ctrl+F5
Reply
#18
Hi Chandrias,
I think before write this register you must set some parameters before. Have you done?
Best regards Cristian Grassi
Reply
#19
(08.08.2026, 16:07)CristianAgata Wrote: Hi Chandrias,
I think before write this register you must set some parameters before. Have you done?
Best regards Cristian Grassi

Yes I did. I also tested writing on that using another software "modbustester" and it works fine

(07.08.2026, 13:12)Daniel Wrote: Did you reboot inverter?

Yes
Reply
#20
LM is not even connecting to your inverter, there must be something wrong in the settings or network.
------------------------------
Ctrl+F5
Reply


Forum Jump: