Good morning
I have the following script for center hole I would like to make some changes
1 at the end gives me the diameter of the hole without the diameter of the probe (5mm).
the diameter of the probe imposed in the DRO oem code function 1000
the final diameter is displayed in the DRO oem code function 1152
Speak ("ricerca centro pezzointerno") 'Avviso Vocale
Message "RICERCA CENTRO PEZZO INTERNO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE RICERCA CENTRO PEZZO INTERNO")
Sleep (1000) ' pausa di 1 secondi
Speak (" CONFERMARE centro pezzo interno") 'Avviso Vocale
Message "INIZIO CENTRO PEZZO INTERNO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE CENTRO PEZZO INTERNO")
Call SetDRO(0,0)
Call SetDRO(1,0)
Xpos = GetParam("XDRO")
Ypos = GetParam("YDRO")
Fcurr = GetParam("FeedRate")
SP = 80 ' avanzamento prima palp impostare diametro mm del cerchio da palpare
VSP = "F200" ' velocita avanzamento prima palp
bkSP = 3 ' ritorno dopo palp mm
VbkSP = "F240" ' velocita ritorno
Spp = 5 ' avanzamento seconda palp mm
VSpp = "F40" ' velocita seconda palp
Code "G31 X" & (GetParam("XDRO")+SP) & (VSP)
While IsMoving()
Wend
Code "G0 X" & (GetParam("XDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend
Code "G31 X" & (GetParam("XDRO")+Spp) & VSpp
While IsMoving()
Wend
B=GetParam("XDRO")
Code "G0 X" & Xpos
Code "G31 X" & (GetParam("XDRO")-SP) & (VSP)
While IsMoving()
Wend
Code "G0 X" & (GetParam("XDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend
Code "G31 X" & (GetParam("XDRO")-Spp) & VSpp
While IsMoving()
Wend
A=GetParam("XDRO")
measuredX = B-A
Code "G0 X" & (A+(B-A)/2)
While IsMoving()
Wend
Code "G31 Y" & (GetParam("YDRO")+SP) & (VSP)
While IsMoving()
Wend
Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend
Code "G31 Y" & (GetParam("YDRO")+Spp) & VSpp
While IsMoving()
Wend
B=GetParam("YDRO")
Code "G0 Y" & Ypos
Code "G31 Y" & (GetParam("YDRO")-SP) & (VSP)
While IsMoving()
Wend
Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend
Code "G31 Y" & (GetParam("YDRO")-Spp) & VSpp
While IsMoving()
Wend
A=GetParam("YDRO")
measuredY = B-A
Code "G0 Y" & (A+(B-A)/2)
SetParam("FeedRate",Fcurr)
MsgBox (" Measurement X: " & nFmt(measuredX,3) & " mm Measurement Y: " & nFmt(measuredY,3) & " mm")