Thanks for coming back so quickly.
I usually export my jobs by tool length, at this stage I’d rather have it as a standalone macro. I can then test and get familiar with it.
Thanks for the extra commentary that helps. When doing the tool change - how do I know when it pauses? Any chance I can use an external resume button? It’s not on the CM board but I have it.
How does this look? It feels very wrong.
G90
; Go to Safe Z
G53 Z-10
; Go to tool probe X,Y
G53 X10 Y800
G53 Z[TOOL_PROBE_Z]
; Wait until the planner queue is empty
%wait
; Pause the program before probing
M1
; Cancel tool length offset
G49
; Probe toward workpiece with a maximum probe distance
G91 ; Relative positioning
G38.2 Z-150 F75
G0 Z2 ;lift 2mm
G38.2 Z-5 F45 ;Probe Z
G90 ; Absolute positioning
%ORIGINAL_TOOL = [posz]
; A dwell time of one second to make sure the planner queue is empty
G4 P1
; Retract from the touch plate
G91 ; Relative positioning
G0 Z-10
G90
G53 Z-10
; Wait until the planner queue is empty
%wait
; Pause the program for a manual tool change
M1
; Wait until the planner queue is empty
%wait
G53 Z-150
; Pause the program before probing
M1
; Cancel tool length offset
G49
; Probe toward workpiece with a maximum probe distance
G91 ; Relative positioning
G38.2 Z-150 F75
G0 Z2 ;lift 2mm
G38.2 Z-25 F45 ;Probe Z
G90 ; Absolute positioning
; A dwell time of one second to make sure the planner queue is empty
G4 P1
; Update the tool length offset
G43.1 Z[posz-ORIGINAL_TOOL]
; Retract from the touch plate
G91 ; Relative positioning
G0 Z-10
G90 ; Absolute positioning
; Raise to tool change Z
G53 Z[TOOL_CHANGE_Z]
; Wait until the planner queue is empty
%wait
; Pause the program for cleanup (e.g. remove touch plate, wires, etc)
M1
; Go to previous work position
G0 X[X0] Y[Y0]
G53 Z20