Designate tool 99 automatically when using the versaprobe probe buttons

More
18 Nov 2026 21:42 #350810 by SLTwogood
I was wondering if there was a way to automatically change the tool number to tool 99 when using the versaprobe probe buttons. I have forgotten to change my tool to yhe probe tool several times and then I end up with the tool offset as something other than 0. I will play with it tomorrow and see if it is possible. Is there any reason not to? The only time I use the probe buttons is when a probe is supposed to be loaded and a zero offset is required.

Please Log in or Create an account to join the conversation.

More
19 Nov 2026 06:39 #350823 by andypugh
Maybe add something around here:
github.com/LinuxCNC/linuxcnc/blob/2.9/li...robe_routines.py#L99
Like
if STATUS.get_current_tool() != 99:
    return 'Probe {} failed: {} - Must select tool 99'.format(name, rtn)

It might take a little effort to find the right file to edit (ie, the one that is being called on your particular system)

Please Log in or Create an account to join the conversation.

More
19 Nov 2026 10:24 #350838 by SLTwogood
I'm sure there's a better way because my programmer Gemini helped me with this. This is what I have working now. I have a flexihal board running flexipi so I modified the qtdragon_hd_handler.py file. I wanted the VersaProbe probe buttons to load tool 99(my probe) right before probing and then unload to tool 0 which i have as an Empty Tool and then after probing go to absolute Z0. I changed the VersaProbe init section to this:

def init_probe(self):
probe = INFO.get_error_safe_setting('PROBE', 'USE_PROBE', 'none').lower()
if probe == 'versaprobe':
LOG.info("Using Versa Probe")
from qtvcp.widgets.versa_probe import VersaProbe
self.probe = VersaProbe()
self.probe.setObjectName('versaprobe')
# --- Custom Tool 99 Auto-Load / Unload Wrapper ---
# 1. Hook into the START of any VersaProbe routine
if hasattr(self.probe, 'start_probe'):
orig_start_probe = self.probe.start_probe
def custom_start_probe(cmd):
# Run G-code BEFORE probing starts (e.g., load Tool 99 & offset)
ACTION.CALL_MDI_WAIT('M61 Q99 G43')
return orig_start_probe(cmd)
self.probe.start_probe = custom_start_probe
# 2. Hook into the END of any VersaProbe routine
if hasattr(self.probe, 'process_finished'):
orig_process_finished = self.probe.process_finished
def custom_process_finished(exitCode, exitStatus):
# Let VersaProbe finish its normal cleanup and DRO updates first
result = orig_process_finished(exitCode, exitStatus)
# Run G-code AFTER probing completes (e.g., reset to Tool 0)
ACTION.CALL_MDI_WAIT('G53 G0 Z0')
ACTION.CALL_MDI_WAIT('M61 Q0 G49')
return result
self.probe.process_finished = custom_process_finished
#

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.145 seconds
Powered by Kunena Forum