Switchoffset = GetOEMDRO(1045)
PipeD = GetOEMDRO(1046)
BeamW = GetOEMDRO(1047)
BeamH = GetOEMDRO(1048)
PipeR = (PipeD/2)
BeamR = (BeamH/2)
ClearZ1 = (BeamR + 0.500)
ClearZ2 = (PipeR + 0.500)
rapidZdist = 5.592
rapidZBOX = (rapidZdist - BeamR) - 0.500
rapidZROUND = (rapidZdist - PipeR) - 0.500
If (BeamH > .5) Then
code "G53 G00 Z-.500"
While Ismoving()
Wend
code "G00 Y0.00"
While Ismoving()
Wend
code "G53 G00 A0.00"
While Ismoving()
Wend
code "G53 G00 Z- " & rapidZBOX
While Ismoving()
Wend
SetDro(2,0)
Code "G31 z-6.00 f30"
While Ismoving()
Wend
zprobepos = GetVar (2002)
Code "G01 Z" & zprobepos
While Ismoving()
Wend
SetDro(2,0)
sleep 500
code "G00 Z" & Switchoffset
While Ismoving()
Wend
SetDro(2,BeamR)
sleep 500
code "G00 Z " & ClearZ1
Else
code "G53 G00 Z-.500"
While Ismoving()
Wend
code "G00 Y0.00"
While Ismoving()
Wend
code "G53 G00 Z- " & rapidZROUND
While Ismoving()
Wend
SetDro(2,0)
Code "G31 z-6.00 f30"
While Ismoving()
Wend
SetDro(2,0)
sleep 500
code "G00 Z" & Switchoffset
While Ismoving()
Wend
SetDro(2,PipeR)
sleep 500
code "G00 Z " & ClearZ2
End If