Hi All
I am having a small issue with some code I added to this script.
The code works fine, slowly lowers the Z till it touches my probe and retracts back up. But my probe is fairly thick 0.6875". So after it retractes I wanted to pause for a couple of seconds so I can remove the probe and then move Z down to 0.2" above the work surface.
The code I added is
Code "G4 P5"
Code "G0 Z0.2"
But the program ignores the G4 P5 line and just drives the bit into my probe.
Here is the rest of the code, the code I added is in red. Not sure if I put it in the wrong place or need to add/modify it?
PlateThickness = GetUserDRO(.6875) 'Z-plate thickness DRO
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P5" ' this delay gives me time to get from computer to hold probe in place
Code "G31Z-40 F10" '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.8875" 'put the Z retract height you want here
Code "G4 P5"
Code "G0 Z0.2"
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 applicable
Exit Sub
End If