Hi All, I have just completed the hardware installation of a height checker and need some help with a subroutine to auto reset the z height during the execution of a plasma gcode. My sensor is a small pneumatic cylinder with a reed switch attached which I can adjust to a preset position. i have used the coolant function to deploy the probe which stops below the plasma nozzle so i can move the z axis down until the switch triggers, at this point I want to do aG92 to reset the z axis height and carry on with the job until the next move/cut. I have tried a subroutine which appears to work (does the motions etc) but does not reset the z height. See my sub below.
O1000
M7 ( deploys the probe )
G1 z3.000 Fxx (slowly moves z down until switch triggers. Z going down moves probe up)
G92 Z*********x (Resets the z height with the known value)
M9 (stows the probe)
M99 (return to the main gcode)
Any help will be very welcome!