# OPC UA read data only when it changes

**URL:** <https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286>\
**Category:** Industrial\
**Created:** [6 May 2022 10:30 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286 "2022-05-06T10:30:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![obi1987](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/obi1987/32/57176_2.png) [@obi1987](https://discourse.nodered.org/u/obi1987)\
**Post date:** [6 May 2022 10:30 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286/1 "2022-05-06T10:30:17Z")

</div>

Hi, I want to read data only when it get changes in PLCs.  
Anyone have the idea?

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [6 May 2022 10:59 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286/2 "2022-05-06T10:59:04Z")

</div>

Have a look at the "Filter" node. You can set it to only pass a message if the message has changed.

---

<div class="post-metadata">

**Author:** ![benefit\_union](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@benefit\_union](https://discourse.nodered.org/u/benefit_union)\
**Post date:** [8 May 2022 02:26 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286/3 "2022-05-08T02:26:11Z")

</div>

Which type of PLC had been connected？

---

<div class="post-metadata">

**Author:** ![ThomasNEWHEAT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thomasnewheat/32/61393_2.png) [@ThomasNEWHEAT](https://discourse.nodered.org/u/ThomasNEWHEAT)\
**Post date:** [10 May 2022 13:37 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286/4 "2022-05-10T13:37:23Z")

</div>

Hi,

I am using "Filter" node to read data only when it gets changes in PLCs .

Now I am trying to read data at least one time every hour (even if the data does not change), I did not find a way to do it.

Does someone know how to do it ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 May 2022 17:39 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286/5 "2022-05-10T17:39:40Z")

</div>

Not at computer right now. But probably a couple of trigger nodes. One set to repeat every hour and one set to rate limit to once per hour.

---

<div class="post-metadata">

**Author:** ![mikakaraila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikakaraila/32/37496_2.png) [@mikakaraila](https://discourse.nodered.org/u/mikakaraila)\
**Post date:** [20 June 2022 16:32 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286/6 "2022-06-20T16:32:48Z")

</div>

OPC UA provides monitoring with deadband/absolute filter. Better to use it!

Inside client node, select action: monitor then you have option Deadband with parameters:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/7/774eb42f26184d9acf29ee86734bcd91f8d139a6.png)

---

<div class="post-metadata">

**Author:** ![AnBall](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@AnBall](https://discourse.nodered.org/u/AnBall)\
**Post date:** [5 July 2022 09:54 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286/7 "2022-07-05T09:54:33Z")

</div>

Hi there,

in general I would go with the solution provided by @mikakaraila.

Still, there is also a solution by implementing two nodes in parallel. You can use the "filter"-node for the message pass on value change. And in parallel to that another node that lets messages through by each hour (or any other time interval):  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/7/87bc1068a25d90521a5425d57a82d5f6690c8d3c.png)  
For this one might use the delay node, but configured in a way it has the **action** rate limit and drops intermediate messages:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/5/f54f19be48ec42474ec360fa80b92bcaa438fcaf.png)

Togehter the nodes fulfill your use case, I guess.

In Production we're all united! Cheers!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 September 2022 09:55 UTC](https://discourse.nodered.org/t/opc-ua-read-data-only-when-it-changes/62286/8 "2022-09-03T09:55:22Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
