PDA

View Full Version : loops and subs



d.dixson
04-06-2007, 06:43 PM
Hi, I hope this is the right forum and that someone can tell me what I'm doing wrong...:confused:

This code worked fine, but when it cycled to the end of the job, it just kept going. I've tried moving M30 to different locations ( and watched the simulation in Mach) but it either stops after one completion of one loop or it just keeps going. I hope there is something easy to change for the next time I run this job. Thanks for your time,

Doug

G90G80G49
G56
G82 X0 Y.282 Z-0.042 R0.02 P.35 F15
M98 P0002 L41
%
O0002
G91 X-.565 L43
X24.29 Y.565
M99
G80
%
G54
G0
X0 Y0 Z.1
M30

ger21
04-06-2007, 07:01 PM
Remove the % signs. I didn't run it all the way through, but it seemed to work. Your original program gave an error message.

G90G80G49
G56
G82 X0 Y.282 Z-0.042 R0.02 P.35 F15
M98 P0002 L41
O0002
G91 X-.565 L43
X24.29 Y.565
M99
G80
G54
G0
X0 Y0 Z.1
M30

d.dixson
04-06-2007, 11:12 PM
Thanks for the response Ger. I took out the % signs but it still keeps looping past the 41st time... I reduced the loop cycles and distance to match for 5 loops so I didn't have to wait the hour and 10 minutes to complete the program. After the fifth loop, it looks like it goes to the next set-over cycle of .565 (in Y) and then starts the whole program again. I have tried this same scheme without the canned cycle (drilling) with no better luck. Any more ideas? Thanks.

G90G80G49
G56
G82 X0 Y.282 Z-0.042 R0.02 P.35 F15
M98 P0002 L5

O0002
G91 X-.565 L5
X2.825 Y.565
M99
G80

G54
G0
X0 Y0 Z.1
M30

anddsn
04-06-2007, 11:45 PM
G90g80g49
G56
G82 X0 Y.282 Z-0.042 R0.02 P.35 F15
M98 P0002 L5

M98p0003

O0002
G91 X-.565 L5
X2.825 Y.565
M99

O0003
G80
G54
G0
X0 Y0 Z.1
M30

d.dixson
04-07-2007, 01:31 AM
Thank you so much anddsn!! That works! I wish I understood how that breaks the loop, but for now, I'll just run with it! Thanks again,

Doug

anddsn
04-07-2007, 06:25 PM
Doug

The M98 P0002 L5 read from O0002 thru M99 five time, then it goes to the line below (M98 P0002 L5) which is M98P0003. This line istruct it to go to O0003 and when it read the M30 it ends the program and rest it to the beginning.