Modbus binding - duplicate queries

Hi.
Im using modbus binding with OpenHAB on Windows.
I have a problem with duplicate queries that are sended to modbus slave.

My things file:

Bridge modbus:serial:COM14_op_44 “COM14_ID23” [ port=“COM14”,id=10, baud=115200,stopBits=“1.0”,dataBits=8,parity=“none”,encoding=“rtu”, receiveTimeoutMillis=500, flowControlIn=“none”, flowControlOut=“none”, connectTimeoutMillis=500] {
Bridge poller nastawy “Poller do Sterownik” [ start=2661, length=20, refresh=0, type=“holding”, maxTries=1 ] {
Thing data op_44_N_T_zadana_CWU " " [ readStart=“2661”, readValueType=“int16”, readTransform=“JS(divide10.js)”, writeStart=“2661”, writeValueType=“int16”, writeType=“holding”, writeTransform=“JS(multiply10.js)”, updateUnchangedValuesEveryMillis=180000]
Thing data op_44_N_Lato_Zima " " [ readStart=“2665”, readValueType=“int16”, readTransform=“JS(divide1.js)”, writeStart=“2665”, writeValueType=“int16”, writeType=“holding”, writeTransform=“JS(multiply1.js)”, updateUnchangedValuesEveryMillis=180000]
Thing data op_44_N_KG_Nachylenie_R " " [ readStart=“2666”, readValueType=“int16”, readTransform=“JS(divide10.js)”, writeStart=“2666”, writeValueType=“int16”, writeType=“holding”, writeTransform=“JS(multiply10.js)”, updateUnchangedValuesEveryMillis=180000]
Thing data op_44_N_KG_Nachylenie_S " " [ readStart=“2667”, readValueType=“int16”, readTransform=“JS(divide10.js)”, writeStart=“2667”, writeValueType=“int16”, writeType=“holding”, writeTransform=“JS(multiply10.js)”, updateUnchangedValuesEveryMillis=180000]
Thing data op_44_N_KG_Nachylenie_N " " [ readStart=“2668”, readValueType=“int16”, readTransform=“JS(divide10.js)”, writeStart=“2668”, writeValueType=“int16”, writeType=“holding”, writeTransform=“JS(multiply10.js)”, updateUnchangedValuesEveryMillis=180000]
Thing data op_44_N_KG_Nachylenie_O " " [ readStart=“2669”, readValueType=“int16”, readTransform=“JS(divide10.js)”, writeStart=“2669”, writeValueType=“int16”, writeType=“holding”, writeTransform=“JS(multiply10.js)”, updateUnchangedValuesEveryMillis=180000]

	Thing data 	op_44_N_Min_t_zasilania_CO	" "	    [ readStart="2670", readValueType="int16", readTransform="JS(divide10.js)", writeStart="2670", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)", updateUnchangedValuesEveryMillis=180000]
	Thing data 	op_44_N_Max_t_zasilania_CO	" "	    [ readStart="2671", readValueType="int16", readTransform="JS(divide10.js)", writeStart="2671", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)", updateUnchangedValuesEveryMillis=180000]
	Thing data 	op_44_N_T_zewn_graniczna_CO	" "	    [ readStart="2676", readValueType="int16", readTransform="JS(divide10.js)", writeStart="2676", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)", updateUnchangedValuesEveryMillis=180000]
}

}

My items file:

Number      op_44_i_N_Lato_Zima                            "Nastawa [%s]"        <latozima>         (op_Nastawy_grupa)    {channel="modbus:data:COM14_op_44:nastawy:op_44_N_Lato_Zima:number", autoupdate="false"}
Number      op_44_i_N_KG_Nachylenie_R                      "Nachylenie R [%s]"   <line_2>      	   (op_Nastawy_grupa)    {channel="modbus:data:COM14_op_44:nastawy:op_44_N_KG_Nachylenie_R:number", autoupdate="false"}
Number      op_44_i_N_KG_Nachylenie_S                      "Nachylenie S [%s]"   <line_2>           (op_Nastawy_grupa)    {channel="modbus:data:COM14_op_44:nastawy:op_44_N_KG_Nachylenie_S:number", autoupdate="false"}
Number      op_44_i_N_KG_Nachylenie_N                      "Nachylenie N [%s]"   <line_2>           (op_Nastawy_grupa)    {channel="modbus:data:COM14_op_44:nastawy:op_44_N_KG_Nachylenie_N:number", autoupdate="false"}
Number      op_44_i_N_KG_Nachylenie_O                      "Nachylenie O [%s]"   <line_2>           (op_Nastawy_grupa)    {channel="modbus:data:COM14_op_44:nastawy:op_44_N_KG_Nachylenie_O:number", autoupdate="false"}
Number      op_44_i_N_Max_t_zasilania_CO                   "Nastawa [%s]"        <temperature_hot>  (op_Nastawy_grupa)    {channel="modbus:data:Opole_COM14_op_44:nastawy:op_44_N_Max_t_zasilania_CO:number", autoupdate="false"}
Number      op_44_i_N_Min_t_zasilania_CO                   "Nastawa [%s]"        <temperature_cold> (op_Nastawy_grupa)    {channel="modbus:data:Opole_COM14_op_44:nastawy:op_44_N_Min_t_zasilania_CO:number", autoupdate="false"}
Number      op_44_i_N_T_zewn_graniczna_CO                  "Nastawa [%s]"        <temperature>      (op_Nastawy_grupa)    {channel="modbus:data:COM14_op_44:nastawy:op_44_N_T_zewn_graniczna_CO:number", autoupdate="false"}
Number      op_44_i_N_T_zadana_CWU                         "Nastawa [%s]"        <temperature>      (op_Nastawy_grupa)    {channel="modbus:data:COM14_op_44:nastawy:op_44_N_T_zadana_CWU:number", autoupdate="false"}

When I refresh elements (using a rule), the binding sends the same multiple queries:

2019.06.19 12:30:53.992 >>0,062(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:53.992 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7
2019.06.19 12:30:54.023 >>0,031(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:54.023 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7
2019.06.19 12:30:54.086 >>0,063(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:54.086 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7
2019.06.19 12:30:54.148 >>0,062(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:54.148 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7
2019.06.19 12:30:54.211 >>0,063(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:54.211 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7
2019.06.19 12:30:54.273 >>0,062(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:54.273 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7
2019.06.19 12:30:54.305 >>0,032(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:54.305 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7
2019.06.19 12:30:54.367 >>0,062(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:54.367 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7
2019.06.19 12:30:54.430 >>0,063(8):2C 03 0B 00 00 0A C1 94
2019.06.19 12:30:54.430 <<0,000(25):2C 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1 B7

The secret rule, perhaps?

Issuing a REFRESH to an Item causes the Modbus binding to invoke the poller that includes the channel.
Issuing a REFRESH to another Item shortly afterwards causes … you get the idea.

A REFRESH of an Item will also effectively REFRESH any other Items linked to the same poller Thing.

Poller Thing parameter cacheMilis may be useful here. It defaults to 50mS, but you could set it longer; repeated REFRESH for the same poller will be served from a cache instead of invoking a poll.

1 Like

Thank you for your quick response. I will check the idea witch cacheMilis

@Piotr_Nowicki have you solved it?

There was not a problem to solve, only understand how the binding works.

What’s your problem?