Page 1 of 1

Repetitive work

Posted: Wed Apr 14, 2021 3:10 pm
by carlos2186
Hi all, got a question. I've been doing some repetitive work on my CNC. I've been doing some repetitive gcode. So I want to make a gcode loop x amount of times with a stop at the beginning of the code so I can change my piece... I've reading and I found that the M02 can work for me but the issue that I have with that is that the post processor form vectric generates the code as follow... Machine got to part zero, machine goes to home, the run the m6 macro asking me if I want to set up z height or wanted to keep the same... Is there any way I can tell the g code to run at specific line number when looping?.

Re: Repetitive work

Posted: Wed Apr 14, 2021 4:01 pm
by tblough
Look at IF THEN ELSE and GOTO in the CNC12 operator's manual.

Re: Repetitive work

Posted: Wed Apr 14, 2021 4:26 pm
by Sword
I use an external cycle start button (can just use the on screen or MPG one as well) and my Vectric post places the following code in the file...

N100 ; This is where I want to restart the loop at.

Body of code next...
XYZ location for waiting until cycle start when body of code is finished...

M200 "Press Cycle Start to continue\nCycle Cancel to quit"
GOTO 100

I have the M200 and GOTO automatically commented out and just enable them when I have need for a looping file. If you want to edit your .pp, let me know if you want the needed .pp bits.

Re: Repetitive work

Posted: Wed Apr 14, 2021 9:31 pm
by carlos2186
Sword wrote: Wed Apr 14, 2021 4:26 pm I use an external cycle start button (can just use the on screen or MPG one as well) and my Vectric post places the following code in the file...

N100 ; This is where I want to restart the loop at.

Body of code next...
XYZ location for waiting until cycle start when body of code is finished...

M200 "Press Cycle Start to continue\nCycle Cancel to quit"
GOTO 100

I have the M200 and GOTO automatically commented out and just enable them when I have need for a looping file. If you want to edit your .pp, let me know if you want the needed .pp bits.
That would be great if you can help me with my pp since I'm kind of lost in that area

Re: Repetitive work

Posted: Thu Apr 15, 2021 12:36 am
by Sword
What post are you currently using in Vcarve/Aspire? You can open it in an editor and place these lines in the proper places and then test the output to see if it's where you intend for it to be (again, by reading the resulting code in an editor). Otherwise, I can add it to a generic pp file and you can try it. You could name it as a loop or repeater so you can choose it from the list of posts when needed. You can designate the park location when you set up your file or you could use one of the G28 locations and call that from the postp as well. I just remove the ; when I want it and I generally edit the file for a preferred park or back off location.

This N100 might already be in the standard post, but that's all you need at the top.

Code: Select all

" ;Begin Feed
""
"N100"
Place the M200 etc. at the end of the feed moves, just after the begin footer line that is likely already there. If setting it up as a specific post for repeating, leave out the ;

Code: Select all

begin FOOTER

""
" ;M200 [34]Press Cycle Start to continue\nCycle Cancel to quit[34]"
" ;GOTO 100"
Again, if you are using the standard unedited post, I could edit one and attach it. My post is highly modified for my purposes and it wouldn't be a good idea for you to test run it with your machine.