Compare two succesive payloads

Hi all,

I am reading the weight given by a scale through the serial port. The scale transmits the weight value in a ratio of 10 measures per second (approx.), and I put both the weight value and the time of lecture into the object.

I want to obtain the mass flow (in kg/hour or gr/min, or whatever), and to do that I have to compare two different outputs (different events), but I don't know how to do it in Node-RED.

Can you give any idea?
Thanks!

Have a look at the node red docs page on Writing Functions. In there it will show you have you can use the node context in a Function node to save the previous value, so you can pick that up and compare it with the current one.
Come back after you have read and digested that if you can't work it out.

Thanks!
I had the answer in front of me and I didn't see it...

It was much more easy than what I was thinking about (something like attaching a mark to an object that goes back in the flow and joins with the new input...),

Thanks again

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