Page 1 of 1

Program restarts after M30

Posted: Thu Sep 22, 2022 2:58 pm
by schric11
Hey,

I have a question is there a parameter that reruns the program without hitting cycle start...?

I set my part counter to 132 and turn repeat on. The problem is the program goes to M30 and then reruns the program. I have to add an M00 to stop the machine and load another part. My other machine doesn't do that.

Re: Program restarts after M30

Posted: Thu Sep 22, 2022 4:14 pm
by Sword
My preferred way is by using a remote cycle start button connected to an input set to CycleStart2. Then any job that requires a part/blank to be changed, has this bit of code at the end that sends it back to the beginning (or wherever N100 is placed).

Code: Select all

N100

Body of code

M200 "Press Cycle Start to continue\nCycle Cancel to quit"
GOTO 100
My post processor automatically puts it in every file, but it's commented out. If/when I need it, I just uncomment it and also make any modifications for park position or spindle control if needed.

Re: Program restarts after M30

Posted: Fri Sep 23, 2022 1:17 am
by cncsnw
In some software versions (e.g. v3.14), the default M30 acts like an M2 (restart the program).

In other software versions (e.g. v3.12 and earlier), the default M30 does nothing at all (allowing the program to end).

In other software versions (e.g. v3.16 and later) the default M30 action is selectable by Parameter 2, bit 6.

If you are going to use the "job repeat" function, then you want M30 to do nothing. If you are using v3.14, you can probably accomplish that by creating a blank "mfunc30.mac" file.

However, if you are changing parts by hand between cycles, then there is no reason to use the "job repeat" function. That is intended for auto-loading machines (e.g. bar feed or bar puller).

Re: Program restarts after M30

Posted: Fri Sep 23, 2022 12:21 pm
by cncsnw
You could also just delete the M30 code from the end of your CNC programs. Then they will end normally when they come to the end of the file, regardless of what CNC11 or CNC12 version you happen to be using.

Re: Program restarts after M30

Posted: Mon Sep 26, 2022 12:35 pm
by schric11
thank you, I will try shutting off repeat and or deleting m30

I do not see any documentation on bit 6 of parameter 2 (G code interpretation) CNC 12-D Mill V4.14

Re: Program restarts after M30

Posted: Tue Sep 27, 2022 12:48 pm
by cncsnw
It probably has not made it into the manual yet.

From the release notes for CNC11 v3.16:
Lathe: The "Restart Program" action of the default M30 is now selectable. Parameter 2 bit 6 (value 64) selects whether or not the default M30 will act like a default M2 (Restart Program). If set on, the default M30 will be equivalent to the default M2.

Re: Program restarts after M30

Posted: Fri Sep 30, 2022 8:15 am
by schric11
I shut off repeat, then replaced m30 with m2. the program runs and the line box gets to m2 (when running the program) and the machine stops but the cycle time keeps counting and the program stays at the end ...should it do that?

I guess I'm wondering if I can get the control to stop counting time and show the beginning of the program when the cycle ends through the parameters.

Re: Program restarts after M30

Posted: Fri Sep 30, 2022 11:50 am
by cncsnw
The function of M2 is to wait for the cycle start button, then restart the program (just as you report it doing above).

As far as I know, there is no way to get CNC12 to redraw running G-code screen to show that it is running the first line of the program, without having it be running the program. If it is running the program, then the cycle timer will be counting.

If you want it to go back to the start of the program first (and draw that part of the program on the screen), then wait for cycle start, you could use M102 at the end of the program, and an M0 on the first line of the program.

If you don't want the cycle timer to continue counting, then just let the program end (no M2, no M30, no M102, no "GOTO __"). Then press Cycle Start when you want it to start running again.