Hello Guest it is April 19, 2024, 02:45:52 PM

Author Topic: Need help - gcode file hanging Mach3  (Read 3914 times)

0 Members and 1 Guest are viewing this topic.

Need help - gcode file hanging Mach3
« on: February 19, 2011, 02:17:50 PM »
I'm a Mach3 novice, so hopefully someone can help me.  Hopefully this is something I'm misunderstanding, and is easy to fix.

I recently bought a copy of BobCAD v24, and generated some g-code for a 3D model.  I'm using the "Mach3-NoATC" post processor (tried revisions 1 and 2), which my friend says he uses with Mach3.

When I load the g-code file into Mach3, it pops up the "generating toolpath" dialog, which seems to complete, then close, then open up again, then get stuck part way through.  I don't understand why it gets stuck.  You can see in the background, in the Mach3 code window, that it's stopping on line 5400-something, which is an N01 of some subprogram.

I've attached the .NC file.  Does it stick for others too?  Am I doing something wrong?

Re: Need help - gcode file hanging Mach3
« Reply #1 on: February 19, 2011, 05:14:23 PM »
Ok, after playing with this a little longer, I got further, but I don't know enough to understand the new things I've discovered.

I noticed in the Status Line of Mach3 that it has the error message "Return Called with no Sub in effect...looping".  See attached screenshot.  It's hung on line 5658.

So I look at line 5658, and it's about a dozen lines BEFORE the line that is highlighted in the Mach3 code window.  That line is actually 5667.  I think I read somewhere that Mach3 looks ahead a few lines, so that might make sense.

Line 5665 (the next line with content before 5667) reads "N5618 M99 (SUBPROGRAM RETURN)".  I looked at Wikipedia, and an M99 is a subprogram end, which matches the text in the line.

I notice that line 5667 (highlighted in the code window), reads "O11 (SUBPROGRAM OF O100)".  So I looked up what "O" codes are, and they are program names (e.g. "O11").  I assume that includes SUBprogram names, too.

So, in notepad, I put the cursor at the M99 line (5665) and searched UP the file, for the next "O" line.  The next letter "O" above line 5665 occurs on line 47, which reads "O10 (SUBPROGRAM OF O100)".  Lines 47-5665 are a solid block of commands, with no blank lines, and there are no other "M" (or "O") codes between those two lines.

I hope that wasn't too confusing to follow.

This leads me to believe that the root issue may lie on line 47, and that Mach3 is never recognizing the "O10" beginning of the subprogram.  I see on page 10-9 of the Mach3 user manual ( http://www.machsupport.com/docs/Mach3Mill_1.84.pdf ) that the manual's authors at least know this command exists, and I assume recognize it.  And on page 10-10 it gives this info...

Quote
10.5.2 Subroutine labels
A subroutine label is the letter O followed by an integer (with no sign) between 0 and
99999 written with no more than five digits (000009 is not permitted, for example).
Subroutine labels may be used in any order but must be unique in a program although
violation of this rule may not be flagged as an error. Nothing else except a comment should
appear on the same line after a subroutine label.

Can anyone help me from this point?
Re: Need help - gcode file hanging Mach3
« Reply #2 on: February 19, 2011, 05:33:10 PM »
M98 P10 jumps to O10 in your program, but remembers where it came from.
M99 sends it back from the jump location.
M30 ends the file.

You need an M30 before the subprogram so Mach will stop reading (after line N22)

With no M30 the file reads directly through the sub until it sees the M99, but has no place to return to.
Re: Need help - gcode file hanging Mach3
« Reply #3 on: February 19, 2011, 05:37:21 PM »
M98 P10 jumps to O10 in your program, but remembers where it came from.
M99 sends it back from the jump location.
M30 ends the file.

You need an M30 before the subprogram so Mach will stop reading (after line N22)

With no M30 the file reads directly through the sub until it sees the M99, but has no place to return to.

That worked!  Thank you so much!
Re: Need help - gcode file hanging Mach3
« Reply #4 on: February 23, 2011, 06:26:51 PM »
I am not sure if this is the right place to post this question. Can someone please help.
I recently had to replace the C11G breakout board on my  X3 Seig mill,
The problem is that  the new breakout board is different version from the original, and I cannot get the spindle to run.
The board is version 8 from Cnc4pc.
Can someone give me the file needed to run this mill.
Thanks in anticipation.
Eugene.