Performing abs in a rule

Hi all,
I need to perform this formula in a rule:

if(abs(servo_set-servo_pos)>2*100/255){
}

Designer give me an error on abs and on >. I tried to add java.lang.Math but still error.

Please help.
Regards

Marco

Not tested this but try Math::abs(xxx).

Hi Ben,
thanks for hel. I attach full line for future refence:

if(Math::abs(servo_set.floatValue-servo_pos.floatValue)>5*100/255){.......}
1 Like