The Power of the Clip Function

One of the functions that I find myself using quite often is the clip function. The clip function takes a value and limits the returned value between a high and a low value. The function takes three arguments: the low clip value, the passed value and the high clip value. If I used the function like this...

clip ( lowLimit, value, highLimit )

I would get the following results:

lowLimit value highLimit result
5 10 15 10
5 3 15 5
5 27 15 15

I use it when I make setpoint changes. To each of my nodes that contain a setpoint, I also add a high limit attribute and a low limit attribute. When I send my setpoint I use clip to prevent any possibility of sending values outside the range I set with the low limit and high limit.