Logic Machine Forum
Object value update (Modbus) - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Object value update (Modbus) (/showthread.php?tid=647)



Object value update (Modbus) - ivanjose - 26.02.2017

Hi all!

I'm seraching for the best solution for that:
I have several modbus tcp relays connected to LM via wifi. Due to non stable wireless connection rarely, when I write a new value to mapped object, relay doesn't change the state. It's clear, that telegram simply does not reach the relay, but new value is correctly stored in LM's database.

Do I understand correctly, that we need to check a relay state periodically (or after writing new object value) and compare it to the object value? And in case of different values write the correct value to the bus again?

Thx!


RE: Object value update (Modbus) - Erwin van der Zwart - 26.02.2017

iiHi,

Modbus has no active feedback or cyclic sending a value like KNX, it's master <-> slave based so if you want to know a value that is inside a certain slave register you indeed have to read it first with the master and with the replied value from the slave you can compare it with the value you expect it to have.

So yes, you understand it correctly.

In your case i think i would write to the register every poll interval so when connection is there again the value is set in the register every loop. This way you don't need to check it..

i also think (because it's tcp) you could fetch connection error when this occurs, but admin should answer that (:

BR,

Erwin