![]() |
|
Huawei - Input Register not working - Printable Version +- LogicMachine 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: Huawei - Input Register not working (/showthread.php?tid=6527) |
Huawei - Input Register not working - Chandrias - 07.08.2026 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. RE: Huawei - Input Register not working - admin - 07.08.2026 Input registers are read-only. Type must be set to "register" and "writable" flag must be enabled for writing to work. RE: Huawei - Input Register not working - Chandrias - 07.08.2026 I also tried with this configuration, but still no success RE: Huawei - Input Register not working - admin - 07.08.2026 Have you created the device again from scratch after modifying the profile? You should use the Modbus profiler app which allows editing existing devices. RE: Huawei - Input Register not working - Chandrias - 07.08.2026 (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 RE: Huawei - Input Register not working - admin - 07.08.2026 Can you write to any other register? RE: Huawei - Input Register not working - Chandrias - 07.08.2026 (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 RE: Huawei - Input Register not working - Daniel - 07.08.2026 what are the settings when using another application? RE: Huawei - Input Register not working - Chandrias - 07.08.2026 (07.08.2026, 09:40)Daniel Wrote: what are the settings when using another application? RE: Huawei - Input Register not working - admin - 07.08.2026 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()RE: Huawei - Input Register not working - Chandrias - 07.08.2026 (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. I set it to run every 5 seconds and I get these messages RE: Huawei - Input Register not working - admin - 07.08.2026 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? RE: Huawei - Input Register not working - Chandrias - 07.08.2026 (07.08.2026, 11:58)admin Wrote: Are you sure that the IP address is correct? Increase the interval to 60 seconds. 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 RE: Huawei - Input Register not working - admin - 07.08.2026 Have you deleted the device before running the script? What do you have in Modbus tab Error log? RE: Huawei - Input Register not working - Daniel - 07.08.2026 If nothing helps, try rebooting inverter. RE: Huawei - Input Register not working - Chandrias - 07.08.2026 (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 RE: Huawei - Input Register not working - Daniel - 07.08.2026 Did you reboot inverter? RE: Huawei - Input Register not working - CristianAgata - 08.08.2026 Hi Chandrias, I think before write this register you must set some parameters before. Have you done? Best regards Cristian Grassi RE: Huawei - Input Register not working - Chandrias - 09.08.2026 (08.08.2026, 16:07)CristianAgata Wrote: Hi Chandrias, 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 RE: Huawei - Input Register not working - Daniel - 10.08.2026 LM is not even connecting to your inverter, there must be something wrong in the settings or network. |