I’m trying to solve problem with so slow runs script, which is writing to modbus registers.
I have script which makes 3 writes to modbus registers. The scipt run so long time (40-60s). I didn’t know why.
Today I had more time for experiments and maybe I have an idea WHY. But I don’t know how to solve it.
I have a lot of sensors for more modbus devices configured. When I deleted all defined sensors in the modbus device configuration file, the problem disappeared - writing to modbus register was done immediately.
The problem occurs when there are a lot of sensors and especially when some of them are not reachable (e.g. some modbus device is temporarily unreachable). Then the script that writes to the registers runs very slowly.
In my opinion, the reason for this behavior may be, that probably after each write to modbus register all sensors are refreshed, or maybe it is checked whether they are reachable. I don’t know, if I’m right, but it looks like that.
Because it looks like the script waits until all sensors are refreshed, and only then continues with a new write command. And maybe this may be the reason for such a long delay in writing. Is there any way to change this behavior? Or any other idea, why writing takes so long time?