31.10.2024, 10:17
Hello everybody.
Trying to implement communication between LM5 and Deye Hybrid Solar Inverter.
Reading of holding registers is working fine, objects are assigned and being updated normally. However writing is not working.
I had an assumption that writing into object will automatically update corresponding register in slave device. Looks like this assumption was wrong, please confirm?
If so, what is the procedure to write into holding register in slave device? Only trough LUA scripting?
Here is a piece of code I'm trying to use to write a register from LUA script however register is not updated. No any errors in the log. What could be wrong here:
Thank you.
Trying to implement communication between LM5 and Deye Hybrid Solar Inverter.
Reading of holding registers is working fine, objects are assigned and being updated normally. However writing is not working.
I had an assumption that writing into object will automatically update corresponding register in slave device. Looks like this assumption was wrong, please confirm?
If so, what is the procedure to write into holding register in slave device? Only trough LUA scripting?
Here is a piece of code I'm trying to use to write a register from LUA script however register is not updated. No any errors in the log. What could be wrong here:
Code:
if not mb then
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485-1', 9600, 'N', 8, 1, 'H')
mb:connect()
end
--writing 10 into register 168
mb:writeregisters(168, 10)
mb:close()
Thank you.