Hi Tony - I've done this in the past using logic gates - and / or / nor whichever is best suited for your purpose. A question though, when the cut is over and you hand back control of Z to Mach - how do you tell Mach where the Z is? What I mean is: suppose you started cutting when Mach knows Z is at (say) 0. Then, at the end of the cut and because of warpage, the steel is actually higher, say at Z=10mm. When you hand back to Mach, it thinks Z is still at zero - etc. if you see what I mean.