MachMsgTypeYesNo = 4 MachMsgReturnYes = 6 MachMsgReturnNo = 7Q0 = MachMsg("Is Probe at Most Left edge and correct Height?","Probe Placment",MachMsgTypeYesNo)If Q0 = 7 Then Message"Please place Probe at left edge and touchable height"End IfIf Q0 = 6 Then NextPos = Question("Y Direction 1=POS 2=NEG:") Dis = Question("X Distance:")elseif Q0 = 0 ThenEnd IfIf NextPos = 1 Then Code"G91 G31 Y1" While IsMoving Wend  Y1 = GetVar(2001) Sleep(200) Code "G91 G00 Y-0.010" While IsMoving Wend Code "G91 G00 X" & Dis While IsMoving Wend Code"G91 G31 Y1" While IsMoving Wend Y2 = GetVar(2001) Sleep(200) Code "G91 G00 Y-0.010" While IsMoving  Wend Code"G91 G00 Z2" Y3 = Y2-Y1 Y4 = Round (Y1,5) Y5 = Round(Y2,5) Y6 = Round(Y3,5) Elseif NextPos = 0 Then End If If Y4<Y5 Then TapD = "TapLeft"  MsgBox"Squaring Values:" & "  Tap Clamp:" & TapD & "    Diff" & Y6  Q1=MachMsg("Is Fixture Squared?","Fixture Squaring",MachMsgTypeYesNo) Y4 = 0 Y5 = 0 Elseif Y4>Y5 Then TapD = "TapRight"  MsgBox"Squaring Values:" & "  Tap Clamp:" & TapD & "    Diff" & Y6  Q1=MachMsg("Is Fixture Squared?","Fixture Squaring",MachMsgTypeYesNo) Y4 = 0 Y5 = 0 Elseif Y1 = 0 Then End IfIf NextPos = 2 Then Code"G91 G31 Y-1"  While IsMoving Wend  X1 = GetVar(2001) Sleep(200) Code "G91 G00 Y0.010" While IsMoving Wend Code "G91 G00 X" & Dis While IsMoving Wend Code"G91 G31 Y-1" While IsMoving Wend  X2 = GetVar(2001) Sleep(200) Code "G91 G00 X0.010" While IsMoving  Wend Code"G91 G00 Z2" Y3 = Y2-Y1 Y4 = Round (Y1,5) Y5 = Round(Y2,5) Y6 = Round(Y3,5)  Elseif NextPos = 0 Then End If If Y4<Y5 Then TapD = "TapLeft"  MsgBox"Squaring Values:" & "  Tap Clamp:" & TapD & "    Diff" & Y6  Q1=MachMsg("Is Fixture Squared?","Fixture Squaring",MachMsgTypeYesNo) Y4 = 0 Y5 = 0 Elseif Y4>Y5 Then TapD = "TapRight"  MsgBox"Squaring Values:" & "  Tap Clamp:" & TapD & "    Diff" & Y6  Q1=MachMsg("Is Fixture Squared?","Fixture Squaring",MachMsgTypeYesNo) Y4 = 0 Y5 = 0 Elseif Y1 = 0 Then End IfIf NextPos = 0 Then End If If Q1 = 6 Then Message"Fixture Squared" Code"G91 G00 X" & -Dis End If While Q1 = 7  Message"Fixture Not Squared" Code"G91 G00 X" & -Dis & "Z-2"If NextPos = 1 Then Code"G91 G31 Y1" While IsMoving Wend  Y1 = GetVar(2001) Sleep(200) Code "G91 G00 Y-0.010" While IsMoving Wend Code "G91 G00 X" & Dis While IsMoving Wend Code"G91 G31 Y1" While IsMoving Wend Y2 = GetVar(2001) Sleep(200) Code "G91 G00 Y-0.010" While IsMoving  Wend Code"G91 G00 Z2" Y3 = Y2-Y1 Y4 = Round (Y1,5) Y5 = Round(Y2,5) Y6 = Round(Y3,5)  Elseif NextPos = 0 Then End If If Y4<Y5 Then TapD = "TapLeft"  MsgBox"Squaring Values:" & "  Tap Clamp:" & TapD & "    Diff" & Y6  Q1=MachMsg("Is Fixture Squared?","Fixture Squaring",MachMsgTypeYesNo) Y4 = 0 Y5 = 0 Elseif Y4>Y5 Then TapD = "TapRight"  MsgBox"Squaring Values:" & "  Tap Clamp:" & TapD & "    Diff" & Y6  Q1=MachMsg("Is Fixture Squared?","Fixture Squaring",MachMsgTypeYesNo) Y4 = 0 Y5 = 0 Elseif Y1 = 0 Then End IfIf NextPos = 2 Then Code"G91 G31 Y-1"  While IsMoving Wend  X1 = GetVar(2001) Sleep(200) Code "G91 G00 Y0.010" While IsMoving Wend Code "G91 G00 X" & Dis While IsMoving Wend Code"G91 G31 Y-1" While IsMoving Wend  X2 = GetVar(2001) Sleep(200) Code "G91 G00 X0.010" While IsMoving  Wend Code"G91 G00 Z2" Y3 = Y2-Y1 Y4 = Round (Y1,5) Y5 = Round(Y2,5) Y6 = Round(Y3,5)  Elseif NextPos = 0 Then End If If Y4<Y5 Then TapD = "TapLeft"  MsgBox"Squaring Values:" & "  Tap Clamp:" & TapD & "    Diff" & Y6  Q1=MachMsg("Is Fixture Squared?","Fixture Squaring",MachMsgTypeYesNo) Y4 = 0 Y5 = 0 Elseif Y4>Y5 Then TapD = "TapRight"  MsgBox"Squaring Values:" & "  Tap Clamp:" & TapD & "    Diff" & Y6  Q1=MachMsg("Is Fixture Squared?","Fixture Squaring",MachMsgTypeYesNo) Y4 = 0 Y5 = 0 Elseif Y1 = 0 Then End IfIf NextPos = 0 Then End If If Q1 = 6 Then Message"Fixture Squared" Code"G91 G00 X" & -Dis & "Z2" End If Wend