gioreva

Untitled

Dec 5th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. '***********************
  2. '* Routine by Giordano *
  3. '* Asse X -- *
  4. '***********************
  5. CurrentFeed = GetOemDRO(818)
  6. DoSpinStop()
  7. SetDro (0, 0)
  8. XMove = 10.0 'Distanza massima dal tastatore all'avvio della procedura
  9. 'Se non viene trovato entro questo valore darà un errore
  10.  
  11. XOffset = - 1.4 'Spessore del tastatore
  12. XSal = XOffset - 3.0 'Ritorno dell'asse X
  13. StopXmove = 0
  14. If GetOemLed (825)=0 Then 'Led probe
  15. DoOEMButton (1008)
  16. Code "G4 P2.5"
  17. Code "G31 X"& XMove & "F25"
  18. While IsMoving()
  19. Sleep(200)
  20. Wend
  21. Probepos = GetVar(2000) '(2002) Posizione asse Z
  22. '(2001) Posizione asse Y
  23. '(2000) Posizione asse X
  24. If Probepos = XMove Then
  25. responce = MsgBox ("***** ERRORE *****" , 0 , "Errore tastatore" )
  26. Code "G0 X0"
  27. StopXmove = 1
  28. Code "F" &CurrentFeed
  29. End If
  30. If StopXmove = 0 Then
  31. Code "G0 X" & Probepos
  32. While IsMoving ()
  33. Sleep (200)
  34. Wend
  35. End If
  36. Call SetDro (0, XOffset)'XDRO = 0, YDRO = 1, ZDRO = 2
  37. Code "G4 P1"
  38. Code "G0 X" & XSal
  39. Code "(X zeroed)"
  40. Code "F" &CurrentFeed
  41. '**********************************************************************
  42. Diam_Ute = Question ("Inserire il diametro dell'utensile")
  43. setDro (0, XOffset - Diam_Ute / 2)
  44. If Diam_Ute = 0 Then
  45. MsgBox ("Il valore zero non è ammesso. La procedura sarà annullata.")
  46. Exit Sub
  47. End If
  48. '**********************************************************************
  49. Else
  50. Code "(Controllare il contatto di massa del tastatore)"
  51. End If
  52. Exit Sub
  53.  
  54.  
  55.  
Add Comment
Please, Sign In to add comment