Hello all,
I love this thread, and have already made the center and Z height fixtures, and got them to work. Here's the problem, I'd like to be able to use these in the middle of a program upon a tool change. When I try it, a couple of odd things happen. I get the message "Cannot probe with cutter radius comp on" and at other times, "Cannot change units with cutter radius comp on Line number #0". This latter one occurs when using the "Run from here" command, I think. I have added a G40 code to the VB script for the auto tool zero button that I got from this site, in order to cancel the cutter compensation mode before checking the depth.
However, I'm wondering if it's possible to retrieve and store the status of the cutter comp (G-code 41 or 42) at the beginning of the script, cancel it with G40, then run the script listed in this thread, and finally run the appropriate g-code (again G41 or G42) to get back to where I started. This would all be written into the VB script for the Auto Tool Zero button.
There may be an easier way to do this, and if so, I'm all ears!! Thanks in advance!
BTW, I'm including the VB Script as I currently have it below for ease of use.
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
Code "G40" 'This is to cancel the modal G41 or G42 code. (Added by mr. technical)
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
Code "G31Z-2 F5" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z.3" 'put the Z retract height you want here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If