Could use G38.2 to probe instead?
You could hook your height/home switch to the probe input. The manual says it will set variables 5061 through 5066 to the coordinates of the contact point. You could then use 5063, the Z value, to recalculate your offset.
Something like
G38.2 Z-1
G10 P1 Z[#5223 + #5063]
Variable 5223 should be the Z offset for coordinate system 1.
I've never actually used the probe, but it seems it may do what you need. |