Writing Back: Touch Off
Write a G154 additional offset from a probe result — the pattern behind every probing routine.
Reading machine state is half the job. The work-offset variables are writable, and that's where macros earn their keep: G31 feeds until the probe trips, latches where it touched into #5063, and your macro shifts an offset so the touched face becomes Z0. Here you'll write a G154 P1 additional offset (#14003 is its Z) instead of G54.
Your turn
The G31 probe move has already run and its trip position is waiting in #5063. Shift the G154 P1 Z origin (#14003) so that the touched face becomes Z0 in that offset.
The machine gives you
#14003 = -310#5063 = -2.5#14003 = -100#5063 = 1Your program is run once for each set of conditions. It has to work for all of them.
This is a learning simulation — always prove out a program on the actual control before you cut metal.