Someone help, I am trying to write a macro for our CNC that will use the work offset that is already stated in the program and automatically load it into the controller, so that nobody can fat-finger it and mess it up as they are loading the offsets into the controller. If adjustments are needed, they can still be changed in the controller. But, I want to be able to use an if statement so that it cannot be changed by more than .02 or less than .02 without giving an error. Do not want to use a G10 command, want to change the system variables in the macro. Use something like this to call it, just need help writing the macro, im still learning.

O9000
G65 P9023 A24. T#3026 H0.01
M99

Any help will be greatly appreciated! Thank you!