Hello!
I am trying to add a counter to my node-red process. I would like it to add one to the counter every time that the whole process runs once.
This is because I am accumulating a math value until a certain counter value, which then leads to another path.
The mod 10 function is because after 9 counts, the process will move to another path.
Here is the code regarding the counter value I have been trying, the problem is that the counter is not updating and increasing by 1 each process:
packetcount = global.get("packetcount")||0;
packetcount = (packetcount+1) % 10;
packetcount+=1;
node.warn("COUNT: "+ packetcount);
return msg;