I'm about to pull my hair out. I've built a custom touch pad and have customized the Ztouch routine to my liking. I've had some instances where the touch wasn't reliable and the z-zero was set incorrectly (ultimately driving the tool into the table if I didn't notice). I've built in an extra touch action, the results recorded, and compared to an allowable amount of error (0.002") between the last two touches. If not, it should throw an error message.
Everything is working fine except my final > < comparisons. they work fine if I type in actual numbers in place of the variables but the first comparison constantly return a false positive if I use my &ZZeroPDif variable in the comparison. If I change it to "less than" it does not continue the IF statement so it considers it false (incorrectly) I've tried doing some math to the variable just prior to the statement to ensure that it's treating it as a number and that works fine. I have it give me a printout of all of the variables and they're all working and looking perfectly as anticipated. I just can't get this comparison to work correctly. What am I doing wrong?
IF &ZZeroPDif > 0.002 Then MSGBOX (WARNING! Z ZEROING ACCURACY QUESTIONABLE!, OKONLY, WARNING!)
IF &ZZeroPDif < -0.002 Then MSGBOX (WARNING! Z ZEROING ACCURACY QUESTIONABLE!, OKONLY, WARNING!)