[enhancement]to Rate limiting in Delay node to work in milliseconds

#1

I was wanting to use the Delay node in rate limiting mode to control a string of leds but it has a minimum rate of 1 msg/sec

Could it be changed to allow milliseconds as well as secs/minutes/hours/days as it does in standard Delay mode please?

Happy to do mods myself and do a pull-request if required

Simon

Rate Limit questions and Midi question
#2

silly me :slight_smile:
I'd forgotton about the laws of mathematics :astonished:

image

1 Like
#3

Helllo Cymplecy

Have you tried to set to rate limit fractions of second like 0.1 for example?

Take into consideration that you need to select the option of "drop intermediate messages" otherwise the messages coming after are just delayed.

image

From other side consider node-red is not a real time system and depends on processor availability etc.... so working with very low precise times is not the goal and will be more reliable depending on the application to let this to work on an arduino board for example that you can control with node red.

All depending on real needs....

I want to point you one thing that is important to realize.... is not the same:

  • Rate limit 1 message every 250 miliseconds
    -Rate limit 4 messages per seconds

I can explain you better but most probably you already see the difference. The final result on the behavior will be slightly different, have it on mind.

In the example you show suppose the case you are reviving a message every 0.1 sec, what will happen is on first second you will see coming out the messages emitted at 0.1,0.2,0.3 and 0.4 then nothing and after first second is over you will see coming messages emitted at 0.5,0.6,0.7 and 0.8.

If you select intermediate messages drop when first second is over then you will see coming messages emitted at 1.1,1.2,1.3 and 1.4.

This is not the same that allow only 1 message every 250 milliseconds and drop intermediate ones.

Regards

#4

Your quite right - I was wondering why the 1st few leds were coming on together when I redeployed :slight_smile:

Luckily, that is not a real issue for me as it works as I want after the 1st wave - the next time I trigger my flow - all the leds change at same rate as each other.

But good to know why things happen the way they do in Node-RED :slight_smile: