# Operating time node issue

**URL:** https://discourse.nodered.org/t/operating-time-node-issue/19528
**Category:** General
**Created:** [24 December 2019 01:25 UTC](https://discourse.nodered.org/t/operating-time-node-issue/19528 "2019-12-24T01:25:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![KELVINHAN95](https://avatars.discourse-cdn.com/v4/letter/k/90db22/32.png) [@KELVINHAN95](https://discourse.nodered.org/u/KELVINHAN95)
#### Post date: [24 December 2019 01:25 UTC](https://discourse.nodered.org/t/operating-time-node-issue/19528/1 "2019-12-24T01:25:19Z")

</div>

Hi I am having an issue with this current flow. I am using the flow from this website [https://github.com/cflurin/node-red-contrib-dsm/wiki/Operating-time](https://github.com/cflurin/node-red-contrib-dsm/wiki/Operating-time).

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/545b117f6de56469fe6b58a9057d4bb816b23df6.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/96e1d6c5f9498f7e28d7137571252bfc9bb959c5.png)

As you can see in the image above, The first image shows when I inject "off", the operating time and payload is still the same. But after that when I inject "reset", the operating time and payload becomes different.

Is there a way to continuously update the payload even if I inject the "off" or "reset". Cos I need the payload to continuously be updated to calculate my live OEE. (Cos I wanna calculate machine running %).

Machine Running % = (Machine running Time/ Total Working time) \* 100

---

<div class="post-metadata">

### Author: ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)
#### Post date: [24 December 2019 11:38 UTC](https://discourse.nodered.org/t/operating-time-node-issue/19528/2 "2019-12-24T11:38:58Z")

</div>

Hi, Sure you can do it. Please, read the doc and try to modify the configuration.

In the method `reset` you have to set `msg.payload` and `output = true`

---

<div class="post-metadata">

### Author: ![NaniAP](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NaniAP](https://discourse.nodered.org/u/NaniAP)
#### Post date: [8 July 2020 01:38 UTC](https://discourse.nodered.org/t/operating-time-node-issue/19528/3 "2020-07-08T01:38:39Z")

</div>

hi thanks for creating it in github. i need to use the operating time function in my project but cant understand the code. sorry i an not that expert in programming. Any links or explanation on how to use the function?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)
#### Post date: [8 July 2020 07:34 UTC](https://discourse.nodered.org/t/operating-time-node-issue/19528/4 "2020-07-08T07:34:21Z")

</div>

There is no magic in the dms, it's just javascript and some basics about state machine.  
I'd start learning javascript:

[https://developer.mozilla.org/en-US/docs/Web/JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)

[https://www.w3schools.com/js/default.asp](https://www.w3schools.com/js/default.asp)

---

<div class="post-metadata">

### Author: ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)
#### Post date: [25 August 2021 11:33 UTC](https://discourse.nodered.org/t/operating-time-node-issue/19528/5 "2021-08-25T11:33:37Z")

</div>

Hello,

My counter starts with the button.  
I want to start by adding extra time depending on the variable at each start.

Sample:

extra\_time=variable

button is pressed  
00:00:00+extra\_time
