Advertisement
Guest User

Untitled

a guest
Jun 27th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. function OnAbout(event)
  2. ctrl = event:GetTextCtrl()
  3. ctrl:AppendText("EMC2 post processor for Plasma\n")
  4. ctrl:AppendText("by John Thornton\n")
  5. ctrl:AppendText("Modal G-codes and coordinates\n")
  6. ctrl:AppendText("Comments enclosed with ( and )\n")
  7. ctrl:AppendText("Incremental IJ\n")
  8. end
  9.  
  10.  
  11. -- created 8/1/2008
  12. -- For Plasma Cutter
  13.  
  14. function OnInit()
  15. post.SetCommentChars ("()", "[]") --make sure ( and ) characters do not appear in system text
  16. post.Text ("(Filename: ", fileName, ")\n")
  17. post.Text ("(Post processor: ", postName, ")\n")
  18. post.Text ("(Date: ", date, ")\n")
  19. if(scale == metric) then
  20. post.Text ("G21 (Units: Metric)\n") --metric mode
  21. else
  22. post.Text ("G20 (Units: Inches)\n") --inch mode
  23. end
  24. post.Text ("G40 (Cancel Cutter Comp)\n")
  25. post.Text ("G90 (Absolute Mode)\n")
  26. post.Text ("F1 S1 (Feed Rate)\n")
  27. post.Text ("G64 P0.005 (Continuous mode + path tolerance)\n")
  28. post.Text ("G92 X0 Y0\n")
  29. bigArcs = 1 --stitch arc segments together
  30. minArcSize = 0.05 --arcs smaller than this are converted to moves
  31. end
  32.  
  33. function OnNewPart()
  34. post.Text("(Part: ",partName,")\n");
  35. end
  36.  
  37. function OnNewOperation()
  38. post.Text ("(Process: ", operationName, ")\n")
  39. if (plungeRate <= 0) then
  40. post.Warning("WARNING: Plunge rate is zero")
  41. end
  42. if (feedRate <= 0) then
  43. post.Warning("WARNING: Feed rate is zero")
  44. end
  45. end
  46.  
  47. function OnToolChange()
  48. -- post.Text ("M6 T")
  49. -- post.Number (tool, "0")
  50. -- post.Text (" (", toolName, ")\n")
  51. -- post.Eol()
  52. end
  53.  
  54. function OnSpindleChanged()
  55. if (spindleSpeed <= 0) then
  56. post.Warning("WARNING: Spindle speed is zero")
  57. end
  58. end
  59.  
  60. function OnRapid()
  61. post.ModalText ("G0")
  62. post.ModalNumber (" X", endX * scale, "0.0000")
  63. post.ModalNumber (" Y", endY * scale, "0.0000")
  64. post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
  65. post.Eol()
  66. end
  67.  
  68. function OnMove()
  69. post.ModalText ("G1")
  70. post.ModalNumber (" X", endX * scale, "0.0000")
  71. post.ModalNumber (" Y", endY * scale, "0.0000")
  72. post.ModalNumber (" F", feedRate * scale, "0.###")
  73. post.Eol()
  74. end
  75.  
  76. function OnArc()
  77. if(arcAngle <0) then
  78. post.ModalText ("G3")
  79. else
  80. post.ModalText ("G2")
  81. end
  82. post.NonModalNumber (" X", endX * scale, "0.0000")
  83. post.NonModalNumber (" Y", endY * scale, "0.0000")
  84. post.Text (" I")
  85. post.Number ((arcCentreX - currentX) * scale, "0.0000")
  86. post.Text (" J")
  87. post.Number ((arcCentreY - currentY) * scale, "0.0000")
  88. post.Eol()
  89. end
  90.  
  91.  
  92. function OnPenDown()
  93. post.NonModalNumber("o<touchoff> call [" ,pierceHeight * scale ,"0.000" )
  94. post.Text ("] ")
  95. post.NonModalNumber("[", pierceDelay * scale, "0.##")
  96. post.Text ("] ")
  97. post.NonModalNumber("[", cutHeight * scale, "0.##")
  98. post.Text ("] (Touchoff and start cutting)\n")
  99. post.NonModalNumber ("F", feedRate * scale, "0.###")
  100. post.Eol()
  101. end
  102.  
  103. function OnPenUp()
  104. post.Text ("M5 (Torch Off)\n")
  105. end
  106.  
  107. function OnComment()
  108. post.Text(" (",commentText,")\n")
  109. end
  110.  
  111.  
  112. function OnFinish()
  113. post.Text ("G92.1 (Cancel offsets and set to zero)\n")
  114. post.Text ("G0 Z0\n")
  115. post.Text ("M2\n")
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement