Timer in a function node?

Hello
Once again I need some help for the easiest way to solve my issue.
I have a flow that includes a controlled process and at the end heats the water bath in which the mass is processed to 90 degrees. Since I can't measure how hot the mass is, I have to wait that it drops down to 70 degrees. My tests have shown that a waiting time of 120 minutes is good. I cannot measure the water bath because it cools down much faster than my mass.
In order to change the overall flow as little as possible, I would like to install a function at the point where the heating function is activated/deactivated (output is true or false).

When 90 degrees is reached, ignore all changes for 120 minutes and only send a false, regardless of what comes from the previous functions. Continue working normally after 120 minutes

I have the problem that I cannot integrate a timer in a function.
Does anyone have an idea how I can solve this?

I need a timer which is triggered by temperature, then ignores all temperature changes and keeps the signal on false until the time has elapsed.
Either I need this 3 times or I need 3 “virtual relay contacts” to switch off all 3 phase heating controls.

You can use setTimeout in a function node.

But you could also just use a trigger node.

If you really want a timer in a function node, you have to save the timer to a flow context variable and access it each time the function node is triggered. Then you can choose to cancel or replace it.

Yeah gotta be careful about unexpected things with TImers in functions and ending up with unexpected blocking etc.

Can you post up what you have now

From what i am reading you can measure the mass at 70c but for some reason not at 90c ?

But in your 2nd paragraph you state that once 90c is reached - ignore all changes ? How do you know when 90c is reached ?

Assuing this all makes sense - i would use some switch nodes and Flow variables.

  1. If Temperature mode is ON and Temperature = 90c set Flow variable MaxTempReached = yes and Flow Variable TemperatureTimer to 0

  2. Each time through the switch node looks and says MaxTempReached = Yes - increment Flow Variable TemperatureTimer by 1

  3. Check if TemperatureTimer = 120 Reset MaxTempReached to No and Reset TemperatureTimer and drop back into your function node to check the real temperature and initiate more heating etc

i.e. you are essentially leaving your current function in tact and bypassing it with the switch and change nodes

Craig

Or possibly a candidate for a finite state machine - for which there are several nodes available.

hello craigcurtin
I can never measure the mass, only the water bath in which the mass is heated. in the test scenarios I repeatedly measured the mass with a laser thermometer until it cooled down to 70 degrees outside temperature, then I removed it, broke it open and measured the core temperature. This is how I determined the 2 hours from when I can start further processing.
I will work with a flow variable that sets a wait marker when it reaches 90 degrees and starts a timer.
I will switch off the 3 phase heatings with "if then" functions during this time. Actually as you described it.

I had some unpleasant side effects with teimers in the PLC period, where processes were extremely slowed down or simply all stopped during this time waiting for a timer to run its count down.
THX Marc

Hi TotallyInformation
?? Or possibly a candidate for a finite state machine ??
No idea what you mean by that, even a translation into my mother tongue didn't make sense.
A thermal material analysis for the core temperature of a naphthalene-based mixture does not yet exist, in my opinion.
This is certainly feasible in laboratories with a lot of money, but i only have a university laboratory at my disposal. However, we are in experimental prototype production and are not experienced node red programmers.

https://flows.nodered.org/search?term=finite+state&type=node&type=flow&type=collection

It lets you map out "states" and do computations against them.

Not sure if I follow, but I don't think you need a timer for this, if you can measure the water bath temperature, then you could use this temperature signal to decide whether enough time has passed so you can continue to the next step.

Yep would be a perfect candidate - for a FSM - but it takes a fair amount of brain power (for me anyway :rofl:) to translate things into FSM speak.

Craig

1 Like

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