I have been using probing for a while now and it has been working fine. The last couple of days the probing is having a problem. The code I am using has been borrowed from various sources and modified:
Code:
' VBScript For probing Left In the X direction
ProbeDia = GetUserDRO(1152)
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already
Code "(Probe plate is grounded, Operation Aborted)" 'Display Message
Else
Code "G4 P1" 'Pause 1 second to give time to position probe plate
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
Code "F4"
' Probe left
XNew = GetDro(0) - 3 'Probe to current position -3 inches
Code "G31 X" &XNew
While IsMoving() 'Wait for move to complete
Wend
XNew = GetVar(2000) 'Read the touch point
Code "G0 X" &XNew 'Move back to the hit point incase there was an overshoot
While IsMoving ()
Wend
Code "F" &CurrentFeed 'Restore original feed rate
If ProbeDia = 0 Then
SetOemDro(800,0) 'Set X axis to 0
Code "G4 P0.25" 'Pause for Dro to update.
Else
SetOemDro(800,ProbeDia/2) 'Adjust X axis DRO for Probe Diameter
Code "G4 P0.25" 'Pause for Dro to update.
End If
End If
It works perfectly EXCEPT when I hit the "Machine Coords button on Mach3 to display the Machine Coordinates. Once displaying MC and probing the X probe will work fine when the probe is moving to the right, but if I try to probe from the right (probe moving left) the probe takes off to the right and continues until the limit switch stops the movement, similar problem with Y probing.
Any thoughts?
Barry