--************************************************ --*** Set these values up to suit your machine *** -- Values set HERE are in MM. If the value can be set in SheetCAM it is in the UNITS (MM or Inches) you have in SheetCAM --************************************************ refDistance = 25 --this is the distance between each torch reference in MILLIMETRES.(can be set from POST Options button in UNITS) lineNumber = 0 --set this to 1 if you want the G-Code to have assigned line numbers on each line. Default is 0 for LinuxCNC minLength = 0 -- default minumum length of cut for DTHC operation (set dynamically) dthcTune = 1 -- set this to 1 if you are using the new DTHCIV and want variable tuning of Z response from code fullTAP = 1 --set this to 1 for TAP via Hypertherm RS485 (requires options) plasmaDrill = 1 --set this to 1 to use a plasma for a drill tool . Set it to 0 to use a drill or router bit warnings = true -- set this to false to turn off the Check Parameters warnings on a toolchange verbose = true -- set this to false to turn off the G-Code comments (except code snips) -- make sure you have the PROBE input in LINUXCNC Input Signals enabled and mapped to the probe switch input startCode = " M3 S100" --S command needed for LINUXCNC noTouchOff = false -- set to true if you want to run in simulation without touchoffs. Normal setting would be false extTOff = true -- set this to true to use a subroutine in CommandCNC to call a touch off sequence and apply the external switchoffset value. -- Leave this at "true" for commandCNC versions 0.6.0 and later --****************************************************************************************************************************************** -- do not change the following values unless you are told to do so by an experienced LinuxCNC user or vendor of your controller or table toolTrack = .254 -- Default .254 mm. This is the blending tolerance in MM (deviation from toolpath) the Path Blending allows. -- Lower numbers favors tight tracking over the defined feedrate (slows down) toolTolerance = .0254 -- Default .0254 mm.T his is the linear tolerance for multiple nodes in the same toolpath. -- Lower numbers cause nodes out of line by less than the toolTolerance amount to be a single line --******************************************************************************************************************************************* --Scriber X,Y,Z offsets in MILLIMETRES. Do not use inches here even if you want inch code --For the marker use the scriber Z as the offset from Z zero you want the Z to move to during a scribe. --Change these values to suit your scriber setup scriberX = 25 scriberY = 25 scriberZ = 50 --scriber axis. Leave this as nil if the scriber is fixed to the same axis as the torch scriberAxis = nil --this value when set to "true" will set the Z to lift to rapid height between paths when using the marker tool. --if false it will not lift the Z between paths but will at the end markerZ = true drillZ = .250 --these codes are for the DCC extensions and turn the DTHC on/off if you have DTHCII REV1.4 or DTHCIV REV1.6 or higher firmware. Used with --ALL DTHCIV units running with LinuxCNC dynthcOnCode = " M67 E0 Q20" dynthcOffCode = " M67 E0 Q10" statthcONCode = " M68 E0 Q20" statthcOffCode = " M68 E0 Q10" --************************************************************************** --*** End of settings *** --*** DO NOT CHANGE ANYTHING BELOW THIS LINE *** --************************************************************************** function OnAbout(event) ctrl = event:GetTextCtrl() ctrl:AppendText("Custom Post for LinuxCNC for Linux: \n") ctrl:AppendText("without Plate marker\n") ctrl:AppendText("Adds expanded Tooltable parameters (DCC) for Electronics Cut Chart\n") ctrl:AppendText("This version allows setting POST variables") ctrl:AppendText("Use with SheetCAM TNG version 6.0.14 or higher or Development ver 6.1.16 \n") ctrl:AppendText("Designed for use with LINUXCNC version 0.5.0 with Floating head Touch-n-Go\n") local window = ctrl:GetParent() local btn = wx.wxButton(window, wx.wxID_ANY, "Set custom post options") btn:Connect(wx.wxID_ANY, wx.wxEVT_COMMAND_BUTTON_CLICKED, OnButton) ctrl:GetContainingSizer():Insert(2, btn, 0, wx.wxALL, 5) end post.DefineVariable("cutDistance",sc.unitLINEAR,0,1e17) post.DefineVariable("slowPercent",sc.unitPERCENT,-1e17,1e17) softPierce = 0 presetAmps = 0 presetPSI = 0 post.DefineCustomToolParam("PlasmaTool", "Preset volts", "presetVolts", sc.unit0DECPLACE, 49, 0, 200) post.DefineCustomToolParam("PlasmaTool", "DTHC delay -sec", "dthcDelay", sc.unit2DECPLACE, 0, 0, 99) post.DefineCustomToolParam("PlasmaTool", "Tip Size -Amps", "tipSize", sc.unit0DECPLACE, 25, 45, 200) post.DefineCustomToolParam("PlasmaTool", "NO DTHC - 0", "dthcOff", sc.unit0DECPLACE, 1, 0, 1) post.DefineCustomToolParam("JetOperation", "Min Cut Length for DTHC", "minLength", sc.unit1DECPLACE, 1, .0, 100) post.DefineCustomToolParam("FlameTool", "Set Z Zero Manually ? - 1 is YES", "manualZSet", sc.unit0DECPLACE, 0, 1, 1) -- post.DefineCustomToolParam("JetOperation", "Toolpath tracking", "toolTrack", sc.unit3DECPLACE, .010, .0, .100) if (toolTrack) then --nothing else toolTrack = .001 end if(plasmaDrill > 0) then if(fullTAP > 0) then else softPierce = 0 presetAmps = 0 presetPSI = 0 end post.DefineCustomToolParam("DrillOperation", "Peck Delay Sec", "peckPierce", sc.unit2DECPLACE, 0, 0, 1) post.DefineCustomToolParam("DrillOperation", "Soft Mark Percent", "softPeck", sc.unit0DECPLACE, 50, 10, 100) end post.DefineCustomOption("Ref Distance", "refDistance", sc.unitLINEAR, 0, 10000) -- post.DefineCustomOption("Switch Offset", "switchOffset", sc.unitLINEAR, 0, 10000)--took this out to remove swtichOffset from Custom Post Options in LINUX function OnButton(evt) post.ShowCustomOptions("Post settings") end function OnInit() offX = 0 offY = 0 offZ = 0 lastTouchX = 0 lastTouchY = 0 subNumber =100 lastZText = " ZZZZZZZZ" -- some safe values to get LCNC to start processing G code post.Text (" #<_g0-gap> = 2.25 \n") post.Text (" #<_pierce-gap> = .150 \n") post.Text (" #<_cut-gap> = .060 \n") post.Text (" #<_pierce-delay> = .2 \n") post.Text (" #<_w-gap> = .5 \n") post.SetCommentChars ("()", "[]") --make sure ( and ) characters do not appear in system text post.Text (" (Filename: ", fileName, ")\n") post.Text (" (Post processor: ", postName, ")\n") post.Text (" (Date: ", date, ")\n") if(scale == metric) then post.Text (" G21 (Units: Metric)\n") --metric mode else post.Text (" G20 (Units: Inches)\n") --inch mode end post.Text (" F10.0\n G90 G40\n") post.Text (" G64 P") post.Number (toolTrack * scale, "0.000") post.Text(" Q") post.Number (toolTolerance * scale, "0.000") post.Text (" (tracking tolerances set to " , toolTrack * scale, ") \n") post.Text (" #<_firstTime> = 1 \n") -- check all of the DCC variables to make sure there are no nulls if(dthcOff) then --don't do anything else dthcOff = 1 --don't pass a null end if(presetVolts) then --don't do anything else presetVolts = 0 --don't pass a null end if(dthcDelay) then --don't do anything else dthcDelay = 0 --don't pass a null end if(tipSize) then --don't do anything else tipSize = 25 --don't pass a null end if(presetAmps) then --don't do anything else presetAmps = 0 --don't pass a null end if(presetPSI) then --don't do anything else presetPSI = 0 --don't pass a null end if(softPierce) then --don't do anything else softPierce = 100 --don't pass a null end if(entityLength) then --don't do anything else entityLength = 0 --don't pass a null end if plungeSafety < 10 then --minimum plungeSafety clearance is 9mm plungeSafety = 10 end if safeZ <= plungeSafety then --Rapid claearnce has to be greater than plunge safety or we set it to double safeZ = plungeSafety * 2 end off2X = .0254 off2Y = .0254 newOp = false minArcSize = 0.2 --arcs smaller than this are converted to moves firstRef = true currentZAxis = "Z" finalCut = false dist = 9999999 lastz = 0 post.Text (statthcOffCode)--turn off the DTHC no matter the state post.Eol() thcstate = 0 softPeck2 = 0 end function OnNewLine() if (linenumber == 1) then post.Text ("N") post.Number (lineNumber, "0000") lineNumber = lineNumber + 10 else post.Text (" ") end end local function round(x, n)--added by TLC --n = math.pow(10, n or 0) x = x * 100 if x >= 0 then x = math.floor(x + 0.5) else x = math.ceil(x - 0.5) end return x / n end function OnFinish() finalCut = true endXRND = round(endX, 100) endYRND = round(endY, 100) curXRND = round(currentX, 100) curYRND = round(currentY, 100) if (endXRND == curXRND) and (endYRND == curYRND) then --see if the current X and Y position is the same final move post.Text (" (No Parking values detected. Moving back to zero, zero)\n ") endX = 0 endY = 0 else post.Text (" (End of job , noving to predefined Parking position)\n ") end if endZ > safeZ then --use the largest number --nothing else endZ = safeZ end offX = 0 offY = 0 offZ = 0 -- OnRapid()--make the final rapid move post.Text ("G53 G0 X0 Y46 Z0 \n") post.Text ("G92.1 \n") post.Text(" M68 E0 Q900 \n") --resets global DTHC to ON post.Text(statthcOffCode) post.Text(" (DTHC is off)\n"); post.Text(" G4 P.2 \n") post.Text (" M5 M30\n") end function OnRapid() if(endX > 1e17 and endY > 1e17) then --don't update the distance moved if X or Y are unknown local len = math.hypot((endX + offX)-currentX , (endY + offY)-currentY) testlen = len dist = dist + len else testlen = 0 end post.ModalText (" G0 ") post.ModalNumber (" X", (endX + offX) * scale, "0.000") post.ModalNumber (" Y", (endY + offY) * scale, "0.000") if(firstRef == true) or (testlen >= refDistance) then -- post.ModalNumber (" Z", safeZ * scale, "0.000") if (lastZText ~= " Z#<_g0-gap>" ) then post.ModalText (" Z#<_g0-gap>") lastZText = " Z#<_g0-gap>" end else if (lastZText ~= " Z#<_g0-gap>" ) then post.ModalText (" Z#<_g0-gap>") lastZText = " Z#<_g0-gap>" end -- post.ModalNumber (" Z", endZ * scale, "0.000") -- post.ModalText(" Z#<_g0-gap>") end post.Eol() end -- end on Rapid Function function OnMove() local len = math.hypot(endX - currentX , endY - currentY) dist = dist + len post.ModalText (" G1") post.ModalNumber (" X", (endX + offX) * scale, "0.000") post.ModalNumber (" Y", (endY + offY) * scale, "0.000") -- post.ModalNumber (" Z", endZ * scale, "0.000") -- post.ModalText (" Z#<_cut-gap> ") if (lastZText ~= " Z#<_cut-gap> " )then post.ModalText (" Z#<_cut-gap> ") lastZText = " Z#<_cut-gap> " end post.ModalNumber (" F", feedRate * scale, "0.0##") post.Eol() feedRate2 = feedRate if(endZ < currentZ and endZ == cutHeight ) then --this is a Z move on plunge post.ModalNumber (" F", feedRate2 * scale, "0.0###") post.Eol() if(dthcOff > 0 and entityLength * scale > minLength) then --global DTHC is ON and min cut length is OK DynThcOn()--turn on THC at bottom of Z plunge . This moves AMPs back to 100% . else if (softPierce > 0) then -- in case its set the softpierce in pendown and the min cut rule is active so we need to set the DTHC off with AMPs at 100% post.Text(dynthcOffCode)--turn off THC at bottom of Z plunge and set AMPS back to 100% post.Eol() end end else post.ModalNumber (" F", feedRate * scale, "0.0###")--this only runs if if its not a plunge from pierece height post.Eol() if(dthcOff > 0 and entityLength * scale > minLength) then --nothing else DynThcOff()-- takes amps back to 100% with DTHC off end end end --end of OnMove function function OnArc() local radius = math.hypot(currentX - arcCentreX, currentY - arcCentreY) dist = dist + radius * math.abs(arcAngle) if(arcAngle <0) then post.ModalText (" G3") else post.ModalText (" G2") end post.ModalNumber (" X", (endX + offX) * scale, "0.000") post.ModalNumber (" Y", (endY + offY) * scale, "0.000") post.Text (" I") post.Number ((arcCentreX - currentX) * scale, "0.000") post.Text (" J") post.Number ((arcCentreY - currentY) * scale, "0.000") post.ModalNumber (" F", feedRate* scale, "0.0###") post.Eol() end -- end OnArcfunction function DynThcOff() --Dynamic THC on/off is used when sync with motion is needed if(not dynthcOffCode) then return end if(thcstate ==1) then thcstate = 0 post.Text(dynthcOffCode) if (verbose == true) then post.Text(" (DTHC is off)"); end post.Eol() end end function DynThcOn() if(not dynthcOnCode) then return end if(toolClass == "MarkerTool") or (toolClass == "FlameTool") then return end if(thcstate ==0) then thcstate = 1 post.Text(dynthcOnCode) if (verbose == true) then post.Text(" (DTHC is on)"); end post.Eol() return end if(thcstate == 2) then thcstate = 0 end end function StatThcOff() --static THC ON/OFF is used when the THC is to be turned on/off when there is no subsequent motion move if(not statthcOffCode) then return end if(thcstate ==1) then -- if its not on it won't turn it off thcstate = 0 post.Text(statthcOffCode) if (verbose == true) then post.Text(" (DTHC is OFF)\n"); else post.Eol() end post.Eol() post.Text (" G4 P.1 ") post.Eol() end end function StatThcOn() if(not statthcOnCode) then return end if(toolClass == "MarkerTool") or (toolClass == "FlameTool") then return end if(thcstate ==0) then thcstate = 1 post.Text(statthcOnCode) if (verbose == true) then post.Text(" (DTHC is ON)\n"); else post.Eol() end post.Text (" G4 P.1 ") post.Eol() return end if(thcstate == 2) then thcstate = 0 end end function OnPenDown() local len = math.hypot(currentX - lastTouchX , currentY - lastTouchY) if(toolClass == "DrillTool" and plasmaDrill > 0) then if (toolClass == "DrillTool") then --- which is a plasma peck process - no offset if (firstRef == true) or (len >= refDistance)then Reference() offX = 0 offY = 0 offZ = 0 lastTouchX = currentX lastTouchY = currentY post.Text (" G0 Z1.000 \n")-- raise up and fire the torch for 1/2 sec to cycle torch post.Text (startCode.. "\n") post.Text (" G4 P.50 \n") post.Text (" M5") post.Eol() offZ = (drillStart/(-1) ) post.ModalNumber(" Z", offZ * scale, "0.000")-- now we need to drop and pierce the first hole post.Eol() post.Text (startCode.. "\n") if (peckPierce ) then post.Text (" G4 P", peckPierce) post.Text (" (Peck delay time)") post .Eol() end else-- not first ref post.ModalText(" G1") post.ModalNumber(" Z", offZ * scale, "0.000")--move Z down to pierce height prior to firing torch post.Text (" F", plungeRate * scale) post.Eol() post.Text(startCode "\n") if (peckPierce ) then post.Text (" G4 P", peckPierce) post.Text (" (Peck delay time)") post .Eol() end post.Eol() end -- end if plasma drill tool end else -- not a marker or drill tool or plate engraver (maybe a Flametool?) if (firstRef) or (len >= refDistance) then dist = 0 Reference() offX = 0 offY = 0 offZ = 0 lastTouchX = currentX lastTouchY = currentY post.Text (" G1 ")--this adds in a G1 move to the same location to fix LINUXCNC bug of Run From here post.NonModalNumber (" X", (currentX + offX) * scale, "0.000") post.NonModalNumber (" Y", (currentY + offX) * scale, "0.000") if (verbose == true) then post.Text (" (adds in a G1 move to the same location to fix LINUXCNC bug of Run From here)") end post.Eol() end post.Text (" G0 ") -- post.NonModalNumber(" Z", pierceHeight * scale, "0.000") post.ModalText (" Z #<_pierce-gap> ") lastZText = " Z#<_pierce-gap> " if (verbose == true) then post.Text (" (pierce height)") end post.Eol() post.Text (startCode.. "\n") post.Text (" M66 P0 L1 Q3 (wait for ok to move) \n") --wait for ok to move end --end outer loop if (toolClass == "DrillTool") then --we don't want tto add in a pierce dely on top of the peck delay in the drill tool --skip the pierceDelay else if (pierceDelay > 0) then post.Text (" G4 P") -- post.Number (pierceDelay,"0.###") post.Text ("#<_pierce-delay> ") if ( verbose ==true ) then post.Text (" (pierce delay)") end post.Eol() end end thcstate = 0 end --end OnPenDown function function Reference() if (noTouchOff == false) then -- check to see if there is supposed to be touchoffs in the code firstRef = false post.Text(" G0 Z") -- post.Number(plungeSafety * scale, "0.00")--rapid down to safety clearance post.ModalText (" #<_w-gap> ") lastZText = " #<_w-gap> " if ( verbose == true ) then post.Text (" (plunge safety move)") end post.Eol() if (extTOff == true) then -- run the touch off from a stored subroutine GetSubNumber() post.Text (" o call ") if ( verbose == true ) then post.Text (" (external Touch off)") end post.Eol() post.NonModalNumber(" o", subNumber, "0") post.Text (" if[#<_value> LT 0] \n") post.Text (" M0 \n") post.Text (" (MSG, Probing Error!) \n") post.NonModalNumber (" o", subNumber, "0") post.Text (" endif ") post.Eol() else --no probing error checking here for now post.Text (" G38.2 Z") -- Probe Touch-Off post.Number(-plungeSafety * scale, "0.00") post.Text (" F#<_ini[axis_z]plunge_rate> ") if (verbose == true) then post.Text (" (Probe Touch-Off)") end post.Eol() post.Text (" # = [#<_z> - #5063] ") -- Find distance past probe touch if (verbose == true) then post.Text(" (Find distance past probe touch)") end post.Eol() post.Text (" G92 Z[#<_ini[AXIS_2]HOME_OFFSET> + #] ") --Set Z to actual position if (verbose == true) then post.Text(" (Switch Offset)") end end post.Eol() post.CancelModalNumbers() else post.Text ("(Touch Off in this POST has been disabled )") post.Eol () end -- end check for noTouchOff end --end ref function function OnPenUp() if (toolClass == "DrillTool") then --skip the tiny extension else -- post.ModalText (" G0")--this is supposed to add a tiny segment before the M5 -- post.ModalNumber (" X", (currentX + off2X) * scale, "0.000") -- post.ModalNumber (" Y", (currentY + off2Y) * scale, "0.000") -- if (verbose == true) then -- post.Text (" (Add tiny extension)") -- end end -- post.Eol() post.Text (" M5\n") if (toolClass == "PlasmaTool")then post.Text (" o call") -- call the end cut subroutine to sync up the Z from the DTHC post.Eol() end if (thcstate == 1) then StatThcOff() end if (endDelay > 0) then post.Text (" G4 P") post.Number (endDelay,"0.###") if (verbose == true) then post.Text(" (end of cut delay)") end post.Eol() end end --end OnPenUp function function OnNewOperation() newOp = true post.Text (" (Operation: ", operationName, ")\n") if (plungeRate <= 0) then post.Warning("WARNING: Plunge rate is zero") end if (feedRate <= 0) then post.Warning("WARNING: Feed rate is zero") end end--end function function OnToolChange() offX = 0 offY = 0 offZ = 0 if (toolClass =="DrillTool" ) then -- used as a plasma tool post.Text (" (tool number: ", tool ," ") post.Text (" Plasma peck drill )") post.Eol() post.Text (" ( Distance between Touch-offs: " , refDistance * scale, " ") post.Text(" Feedrate: ", feedRate * scale , ") \n") if(scriberAxis and scriberAxis ~= currentZAxis) then endZ = safeZ OnRapid() currentZAxis = scriberAxis end if(scriberAxis and scriberAxis ~= currentZAxis) then endZ = safeZ OnRapid() currentZAxis = scriberAxis end firstRef = true end -- drilltool if (toolClass== "PlasmaTool") then if (verbose == true) then if(dthcOff == 0) then post.Text (" (DTHC has been disabled in this tool)\n") end if(presetVolts >0) then post.Text ( "(Preset Volts: ",presetVolts,") " ) else --post.Text ("(") end if(tipSize>0) then post.Text ( "( Suggested Tip Size: " ,tipSize," )") post.Eol() end if(dthcDelay > 0 ) then post.Text ( " ( DTHC Delay: " ,dthcDelay," sec ) ") post.Eol() else post.Text ( " (Default DTHC Delay )") post.Eol() end if(minLength > 0 ) then post.Text ( " ( Min Cut Length for DTHC ON : " ,minLength ," units ) ") post.Eol() end post.Eol() end -- end of verbose check if(scriberAxis and scriberAxis == currentZAxis) then --always use Z as the Z axis endZ = safeZ OnRapid() currentZAxis = "Z" end if(dthcOff == 0) then post.Text (" M68 E0 Q999 ") if (verbose == true) then post.Text(" (Global DTHC ON/OFF is OFF ) \n") else post.Eol() end post.Text(" G4 P.1 \n" ) else post.Text (" M68 E0 Q900 ") if (verbose == true) then post.Text(" (Global DTHC ON/OFF is ON ) \n") else post.Eol() end post.Text (" G4 P.1 \n" ) end --end dthcOff loop if(presetVolts > 0) then post.Text ( " M68 E0 Q3" ,presetVolts, "" ) if (verbose == true) then post.Text(" (Preset Volts set to ",presetVolts ," Volts)") end post.Eol() post.Text (" G4 P.1 \n") else post.Text ( "(No Preset Volts)\n" ) end --end presetVolts if(dthcDelay > 0 ) then post.Text ( " M68 E0 Q5") post.Number (dthcDelay * 10, "00") ---multiplies times 10 to pass decimal values if (verbose == true) then post.Text(" (DTHC Delay set to ",dthcDelay ," Seconds)") end post.Eol() post.Text (" G4 P.1 \n") end --end dthcDelay if(dthcTune >0 and dthcTune <9) then post.Text (" M68 E0 Q71",dthcTune, " ") --put in the prefix for LINUXCNC if (verbose == true) then post.Text(" (DTHCIV tuning set to level ",dthcTune,")") end post.Eol() post.Text (" G4 P.1 \n") end --end dthcTune --StatThcOff() --after loading values turn off the DTHC post.Text(statthcOffCode) if (verbose == true) then post.Text(" (DTHC is OFF)\n"); else post.Eol() end --post.Eol() post.Text (" G4 P.1 \n ") if(firstRef == true) then --check if controller cutting params are to be used post.Text ("o020 if[ #<_firstTime> EQ 1 ] \n") post.Text (" o010 if[ EXISTS[#<_hal[plasma_tab.use_control_params]>]] \n") post.Text (" o011 if[#<_hal[plasma_tab.use_control_params]> EQ 1] \n") --get G0 gap post.Text (" o012 if[ EXISTS[#<_hal[plasma_tab.g0-gap]>]] \n") post.Text (" #<_g0-gap> = #<_hal[plasma_tab.g0-gap]> \n") post.Text (" o012 else \n") post.Text (" #<_g0-gap> = ") post.Number (safeZ * scale, "0.000") post.Text (" \n") post.Text (" o012 endif \n") --get pierce gap post.Text (" o013 if[ EXISTS[#<_hal[plasma_tab.pierce-gap]>]] \n") post.Text (" #<_pierce-gap> = #<_hal[plasma_tab.pierce-gap]> \n") post.Text (" o013 else \n") post.Text (" #<_pierce-gap> = ") post.Number (pierceHeight * scale, "0.000") post.Text (" \n") post.Text (" o013 endif \n") --get cutting gap post.Text (" o014 if[ EXISTS[#<_hal[plasma_tab.cut-gap]>]] \n") post.Text (" #<_cut-gap> = #<_hal[plasma_tab.cut-gap]> \n") post.Text (" o014 else \n") post.Text (" #<_cut-gap> = ") post.Number (cutHeight * scale, "0.000") post.Text (" \n") post.Text (" o014 endif \n") --get pierce delay post.Text (" o015 if[ EXISTS[#<_hal[plasma_tab.pierce-delay]>]] \n") post.Text (" #<_pierce-delay> = #<_hal[plasma_tab.pierce-delay]> \n") post.Text (" o015 else \n") post.Text (" #<_pierce-delay> = ") post.Number (pierceDelay, "0.000") post.Text (" \n") post.Text (" o015 endif \n") --get w height post.Text (" o016 if[ EXISTS[#<_hal[plasma_tab.w-gap]>]] \n") post.Text (" #<_w-gap> = #<_hal[plasma_tab.w-gap]> \n") post.Text (" o016 else \n") post.Text (" #<_w-gap> = ") post.Number (plungeSafety * scale, "0.000") post.Text (" \n") post.Text (" o016 endif \n") post.Text (" o010 else \n") post.Text (" o011 else \n") --use sheetcam cutting parameters --left in for debug right now post.Text (" (Use values from SheetCam Below) \n") post.Text (" #<_g0-gap> = ") post.Number (safeZ * scale, "0.000") post.Text (" \n") post.Text (" #<_pierce-gap> = ") post.Number (pierceHeight * scale, "0.000") post.Text (" \n") post.Text (" #<_cut-gap> = ") post.Number (cutHeight * scale, "0.000") post.Text (" \n") post.Text (" #<_pierce-delay> = ") post.Number (pierceDelay, "0.000") post.Text (" \n") post.Text (" #<_w-gap> = ") post.Number (plungeSafety * scale, "0.000") post.Text (" \n") post.Text (" o011 endif \n") post.Text (" o010 endif \n") post.Text (" #<_firstTime> = 0 \n") post.Text (" o020 endif \n") end if (warnings == true) then post.Text (" M1") post.Text (" (Settings Check)\n") post.Text ("( ###########################)\n") post.Text (" (Paused: Check the DTHC Settings )\n") post.Text (" ( Hit RUN to continue)\n") post.Text ("( ###########################)\n") else -- post.Text (" M1") post.Text (" (Pause off)\n") post.Text ("( ###########################)\n") end --end warnings end -- end of plasma tool loop end --end for toolchangefunction function OnNewPart() post.Text(" (Part: ",partName,")\n"); end function OnDrill() -- post.Text ("(Drill Process)\n") if (thcstate == 1) then ThcOff() end OnRapid() currentX = endX currentY = endY OnPenDown() endZ = drillZ --OnMove() OnPenUp() endZ = safeZ OnRapid() end function GetSubNumber() subNumber = subNumber + 1 end