# Timers and Timed Actions

**URL:** <https://discourse.nodered.org/t/timers-and-timed-actions/56103>\
**Category:** General\
**Created:** [4 January 2022 20:16 UTC](https://discourse.nodered.org/t/timers-and-timed-actions/56103 "2022-01-04T20:16:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgatlin](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@rgatlin](https://discourse.nodered.org/u/rgatlin)\
**Post date:** [4 January 2022 20:16 UTC](https://discourse.nodered.org/t/timers-and-timed-actions/56103/1 "2022-01-04T20:16:39Z")

</div>

I am currently using node-red-contrib-cip-ethernet-ip and node-red-node-mysql to read tags off a PLC, and push them into a MySQL database for use in another application. What I want to do, is read off the tags at a timed interval (i.e 1 sec), and push these into the database.

I have this roughly implemented, it all works how I want it.. However it also pushes data whenever a value im monitoring changes.

As an example.. Tag 1 and 2 change.. I end up getting 3 logs in my database, 1 where tag 1 changes, 1 where tag 2 changes, and a final one from my 1 second resend.

Is there a way to ensure the changing of tags isn't pushing information into my formula and therefore my SQL, and it only happens every 1 second?

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

As a note, I have tried using a filter node, but it just cuts it down to 2 sends, instead of just a singular 1 every second like I want.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 January 2022 21:15 UTC](https://discourse.nodered.org/t/timers-and-timed-actions/56103/2 "2022-01-04T21:15:47Z")

</div>

Split your flow into 2 parts....

1. Store the values coming from EIP in context using change nodes.
2. On your predefined interval, grab the stored values out of context and send them to database.

---

<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:** [5 March 2022 21:16 UTC](https://discourse.nodered.org/t/timers-and-timed-actions/56103/3 "2022-03-05T21:16:44Z")

</div>

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