PDA

View Full Version : Looping programs



kg4mon
03-08-2010, 11:56 AM
I have a part that I need to cut 100+ times and would like to have it run over and over with a pause in it for changing out the parts. I need to move the gantry down 24 inches in x and have it park with the spindle running and then come back to home and cut the part. we went over this briefly in training 2 1/2 years ago but I've slept since then. I don't get into the writing code that offen and need some help with this one. I read over the progamming handbook pdf but just to be honest I don't have time to play around with this on this job. Can anyone please help.

thanks Rick

Here is the code of the part I'm running.

JS,10.0,2.5
MS,5.0,2.5
SO,1,1
PAUSE
JH
J2,4.066,4.250
JZ,.125
MZ,-.063
CG,,5.169,4.250,.551,.000,T,1
CG,,2.596,4.250,-1.286,.000,T,1
CG,,4.372,6.256,2.021,.000,T,1
CG,,6.260,4.250,-.122,-2.006,T,1
CG,,4.372,6.256,-2.010,.000,T,1
M3,4.372,6.256,.125
JH
END

knight_toolworks
03-08-2010, 12:10 PM
it's simple. put at the beginning
begin:

then before spindle shutdown change the jog command to where you want the machine to park then at
pause,
then goto begin,
this will wait for you to hit enter for it to start again.
if you put this below the spindle off command it will stop then start again when you hit enter.

Gary Campbell
03-08-2010, 12:15 PM
Rick...
I would do something like this:

JS,10.0,2.5
MS,5.0,2.5
SO,1,1
PAUSE 2

BEGIN:
J2,4.066,4.250
JZ,.125
MZ,-.063
CG,,5.169,4.250,.551,.000,T,1
CG,,2.596,4.250,-1.286,.000,T,1
CG,,4.372,6.256,2.021,.000,T,1
CG,,6.260,4.250,-.122,-2.006,T,1
CG,,4.372,6.256,-2.010,.000,T,1
M3,4.372,6.256,.125
JZ,1
JX,24
MSGBOX(ENTER TO REPEAT,YesNo, RESTART FILE)
IF &msganswer = YES then goto BEGIN
END
(note I took out the redundant "JH" commands)
Gary

knight_toolworks
03-08-2010, 12:27 PM
too much work with just the pause, command you get the message box.

kg4mon
03-08-2010, 12:38 PM
Thanks Guys, I went out in the shop and tried a few things. I used a loopstart at the beginning and a goto loopstart at the end. I think I forgot alot. But you get into a routine of using mastercam and artcam for everything and you lose it if you don't use it.

Thanks Rick