GCODE Help (From where to edit with NCViewer?)

Typical story: large job crashes mid-way through.

I ran this particular job several times last night and the job quit at 30%, then 60% and then 70% before I left it to tackle again this AM.

Google led me to NCViewer and I pulled up the GCode. I have no idea what line the job quit at, but I figure if I start at ‘50%’, that should give me some grace.

Is it as simple as determining my total amount of code lines in NCViewer and splitting that in half (roughly)?

If so, what portion of the leading code needs to remain intact? (I’ll post the first 20 lines of code below).

As a note, my setup is:

Shapeoko XXL w/ Makita router

From what I read last night, I’m guessing this falls in to the common category of static build-up. I found a tutorial in the forums for grounding my Makita to the router body, so I will start there.

Here is my code (Thanks in advance):



Hey Mike,
Keep this.

Go to where you think you want to restart, go BACK to the previous retract (G0Z0.8000), and get rid of everything between that retract an the initial one.

Do you turn your router on manually?

Hi Neil -
Thanks for this. I just ran the job again from ‘start’ and an hour later she stopped again at 68.9% (painful!).

This time, I wrote down the ‘current line’, ‘code’ and percentage.

I typically zero, get Motion ready and just before I hit ‘Start’, turn my router on manually. In this case, I left the router and vac off until I got to about 50% then fired up the router and waited for cutting to start before flipping on the vac.

I’m with you RE the gcode up to ‘… get rid of everything between that retract line and the initial one.’

Which line denotes ‘retract’?

I’ll upload the gcode file. In this example, am I safe to delete everything after ‘G0Z0.8000’ and line 11897 in this case (perhaps a few lines prior to 11897?).

Thanks Neil!
P.S. scratch that, can’t upload a Gcode file and the code from NCViewer doesn’t bring in the line numbers.

I think I get it now. I was looking for another G0Z0.800.

I assume ‘G0Z0’ denotes a retract. The closest one that begins with that (and closest to my current line of ‘11897’ where the operation stopped last time), is: G0Z0.2000 at line ‘10914’.

I’m reading you as leaving those G0Z0 lines intact and deleting everything between…?

Thank you again,

Got it! - Running again.
You saved me another hour of frustration. Thank you!!!

1 Like

G0 means “go to, fast”, while G1 is a “go to, at feedrate speed”

G1 is for cutting, G0 is the fast moves done above the material without cutting, but also to go straight up (since going straight up you are by definition not cutting)

Z denotes the depth to go to. negative numbers are below your zero point, so positive numbers are above your material (assuming you zero at the top of your material)… any “move to” that is straight up above the material is a “retract”.

in the gcode you also see G1 X Y… those are the obvious X and Y coordinate moves.

(in one G0 or G1 command you can specify all X Y and Z, the ones you don’t specify are not changing, so just giving a Z0.8 leaves X and Y the same -> straight up)

1 Like

So frustrating - stopping every few percent now… any way to quickly deal w/ ground issue…lol?

Sounds like you got the editing gcode down. That’s a handy skill.
I run my router cord the opposite way as the controller, then to a different outlet, away from where I have the machine controller and PC. That solved most of my problems.


Please contact us at support@carbide3d.com

1 Like

Definitely - grateful to know how to edit the code. Thanks Neil.

Will do. Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.