26.02.2017, 23:20
(This post was last modified: 27.02.2017, 04:46 by Erwin van der Zwart.)
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
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