16i Control
Is it possible to round a machine position, #5021-#5024, to 4 decimal places and store in common variables table. If so how?
Thanks a million!!
16i Control
Is it possible to round a machine position, #5021-#5024, to 4 decimal places and store in common variables table. If so how?
Thanks a million!!
Have you tried:
#500=ROUND[#5021]
Never had to do this but it should work.
#500=ROUND[#5003] WOULD BE FOR CURRENT Z POSITION
#501=ROUND[#5002] WOULD BE FOR CURRENT Y POSITION
#502=ROUND[#5001] WOULD BE FOR CURRENT X POSITION
It rounds to nearest whole number, I need to be closer than that.
How about
#500=#5001 for current x position and so on for y and z with no rounding used? That should give you a number with four places after the decimal.
What you need to do is pull the number you are looking for, (#5021-#5024) for instance, into a variable (#500 = #5021). Then multiply that variable by 10, 100, 1000, 10000 depending on how far out you want to round. I.E. #500 = #500 * 1000. This will get you to the digit you want to round to. Then perform the ROUND command on that variable (#500 = [ROUND#500] ). And then divide by the number you previously multiplied by (#500 = #500 / 1000).