215
« on: February 10, 2016, 11:04:07 PM »
You will want to do the probing in INC (G91)mode. You hve to gather teh trip point values for both sides of teh circle. ( X1 ,X2 )You can then do a positional move in INC after you proper calculate the value you need to move OR simply switch to ABS (G90) mode to do a positional move to Center of space. Then switch back to INC to do teh next G31 call and repeat as needed.
Code "G91" ' Switch to INC mode
Code" G31 X-7 F8" 'Probe in X- direction
While IsMoving()
Wend
X1 = GetVar(2000) ' Collect X1 trip position
While IsMoving()
Wend
Code " G0 X.050" ' Back off switch in X + direction
While IsMoving()
Wend
Code " G31 X14 F8" ' Probe X + Direction
While IsMoving()
Wend
X2 = GetVar(2000) ' Collect X2 trip position
While Ismoving()
Wend
Xc =( X2 - X1) ' This assumes you are in Quandrant 1
While IsMoving()
Wend
Code" G90" ' Switch to ABS mode
Code" G0 X" & Xc ' Move to X center position