Process item heading

Request and discuss new features
Post Reply
regpye
Posts: 57
Joined: Sat Nov 09, 2019 1:12 am
Location: South Australia

Process item heading

Post by regpye »

I am not sure if this is already available or not as I have not been able to find it.
Recently a new feature was introduced to Universal Gcode Sender, and that was to use the "send from here" feature in case a problem developed in doing a process. I actually asked for the feature to be added and found that several others in the past had also asked for that feature, and now it is available.
While using it for plasma cutting, which is my concern, I found that there was a need to add something in the gcode generated by SheetCam that would make it easier to find where to start from here for the failed process.
I think it would be possible, if not already available, to use the post processor file to generate a heading for each process so that it would be easier to locate in the gcode file. I am not sure how to go about this myself, so I thought I may ask here if that is possible or already available.
User avatar
Les Newell
Site Admin
Posts: 3660
Joined: Thu May 11, 2006 8:12 pm

Re: Process item heading

Post by Les Newell »

Sorry, I missed this post. Yes, the post processor can be configured output the operation name. What post processor are you using?
regpye
Posts: 57
Joined: Sat Nov 09, 2019 1:12 am
Location: South Australia

Re: Process item heading

Post by regpye »

Les Newell wrote: Mon May 11, 2020 10:56 am Sorry, I missed this post. Yes, the post processor can be configured output the operation name. What post processor are you using?
firstPierceTime = 0 --this is an extra delay added to the first pierce as needed by some machines

function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("GRBL plasma post processor\n")
ctrl:AppendText("\n")
ctrl:AppendText("Generic plasma post for machines with or without THC\n")
ctrl:AppendText("\n")
ctrl:AppendText("Modal G-codes and coordinates\n")
ctrl:AppendText("No comments\n")
ctrl:AppendText("M04/M05 turn the torch on/off\n")
ctrl:AppendText("Incremental IJ\n")
end

function OnInit()

post.SetCommentChars ("()", "[]") --make sure ( and ) characters do not appear in system text
if(scale == metric) then
post.Text (" G21\n") --metric mode
else
post.Text (" G20\n") --inch mode
end
bigArcs = 1 --stitch arc segments together
minArcSize = 0.05 --arcs smaller than this are converted to moves
firstPierce = firstPierceTime
end

function OnFinish()
post.Text (" M05 M9 M30\n")
end

function OnRapid()
post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.Eol()
end

function OnMove()
post.ModalText (" G01")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.ModalNumber (" F", feedRate * scale, "0.0###")
post.Eol()
end

function OnArc()
if(arcAngle <0) then
post.ModalText (" G03")
else
post.ModalText (" G02")
end
post.NonModalNumber (" X", endX * scale, "0.0000")
post.NonModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.Text (" I")
post.Number ((arcCentreX - currentX) * scale, "0.0000")
post.Text (" J")
post.Number ((arcCentreY - currentY) * scale, "0.0000")
post.ModalNumber (" F", feedRate * scale, "0.0###")
post.Eol()
end


function OnPenDown()
if (preheat > 0.001) then
post.ModalText (" G00")
post.ModalNumber (" Z", cutHeight * scale, "0.0000")
post.Text ("\n G04 P")
post.Number (preheat,"0.###")
post.Eol()
end
post.ModalText (" G00")
post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
post.Text ("\n M04 M8\n")
if (pierceDelay + firstPierce > 0.001) then
post.Text (" G04 P")
post.Number (pierceDelay + firstPierce,"0.###")
firstPierce = 0
post.Eol()
end
end


function OnPenUp()
post.Text (" M05 M9\n")
if (endDelay > 0) then
post.Text (" G04 P")
post.Number (endDelay,"0.###")
post.Eol()
end
end


function OnDrill()
OnRapid()
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end
User avatar
Les Newell
Site Admin
Posts: 3660
Joined: Thu May 11, 2006 8:12 pm

Re: Process item heading

Post by Les Newell »

Add this code:

Code: Select all

function OnNewOperation()
   post.Text (";Operation: ", operationName, "\n")
end
regpye
Posts: 57
Joined: Sat Nov 09, 2019 1:12 am
Location: South Australia

Re: Process item heading

Post by regpye »

Tried it out and it works perfectly, thanks Les. :P
Post Reply