Advertisement
Guest User

Untitled

a guest
May 12th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. o<change> sub
  2. (debug, in change tool_in_spindle=#<tool_in_spindle> current_pocket=#<current_pocket>)
  3. (debug, selected_tool=#<selected_tool> selected_pocket=#<selected_pocket>)
  4.  
  5. ;otherwise after the M6 this information is gone!
  6. #<tool> = #<selected_tool>
  7. #<pocket> = #<selected_pocket>
  8.  
  9. ; we must execute this only in the milltask interpreter
  10. ; or preview will break, so test for '#<_task>' which is 1 for
  11. ; the milltask interpreter and 0 in the UI's
  12. O100 if [#<_task> EQ 0]
  13. (debug, Task ist Null)
  14. O100 return [999]
  15. O100 endif
  16.  
  17. ;first go up
  18. G53 G0 Z[#<_ini[CHANGE_POSITION]Z>]
  19. ; then move to change position
  20. G53 G0 X[#<_ini[CHANGE_POSITION]X>] Y[#<_ini[CHANGE_POSITION]Y>]
  21.  
  22. ; cancel tool offset
  23. G49
  24.  
  25. ; using the code being remapped here means 'use builtin behaviour'
  26. M6
  27.  
  28. O200 if [#<_hal[gmoccapy.toolmeasurement]> EQ 0]
  29. O200 return [3] ; indicate no tool measurement
  30. O200 endif
  31.  
  32. G53 G0 X[#<_ini[TOOLSENSOR]X>] Y[#<_ini[TOOLSENSOR]Y>]
  33. G53 G0 Z[#<_ini[TOOLSENSOR]Z>]
  34.  
  35. O300 if [#<_hal[gmoccapy.searchvel]> LE 0]
  36. O300 return [-1] ; indicate searchvel <= 0
  37. O300 endif
  38.  
  39. O400 if [#<_hal[gmoccapy.probevel]> LE 0]
  40. O400 return [-2] ; indicate probevel <= 0
  41. O400 endif
  42.  
  43. F #<_hal[gmoccapy.searchvel]>
  44. G91
  45. o<connectclipmsg> call
  46. G38.2 Z #<_ini[TOOLSENSOR]MAXPROBE>
  47. G0 Z2
  48. ; This is commented out only for sim.
  49. F #<_hal[gmoccapy.probevel]>
  50. G38.2 Z-4
  51.  
  52. O500 if [#5070 EQ 0]
  53. G90
  54. O500 return [-3] ; indicate probe contact failure to epilog
  55. O500 endif
  56.  
  57. G90
  58. G53 G0 Z[#<_ini[CHANGE_POSITION]Z>]
  59.  
  60. #<touch_result> = #5063
  61. #<probeheight> = #<_hal[gmoccapy.probeheight]>
  62. #<blockheight> = #<_hal[gmoccapy.blockheight]>
  63.  
  64. (DEBUG, #<touch_result> #<probeheight> #<blockheight>)
  65.  
  66. G10 L1 P#<tool> Z[#<touch_result> - #<_hal[gmoccapy.probeheight]> + #<_hal[gmoccapy.blockheight]>]
  67. G43
  68.  
  69. ;G10 L1 P#<tool> Z#<touch_result>
  70. ;G10 L2 P0 Z[#<workpieceheight> + #<probeheight> + #<touch_result>]
  71.  
  72. o<disconnectclipmsg> call
  73.  
  74. ; signal success be returning a value > 0:
  75. o<change> endsub [1]
  76. M2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement