Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: jimpinder on July 20, 2007, 06:30:31 AM

Title: G code subroutines ??
Post by: jimpinder on July 20, 2007, 06:30:31 AM
Is there any way of doing subroutines in G code - as in computer programming.

I am trying to do a program to cut steel connecting rods for locomotives out of 1/2 inch bar, I have done the outline in G code and tested in. I now want to repeat that as many times as is necessary to cut through the 1/2inch bar. In computer programming the outline cut would be a suroutine and I would call it as many times as necessary, dropping the cutter each time.

I see there is something similar in the canned cycles, for repeat drilling - but does it extend to making your own canned cycle for general use ???
Title: Re: G code subroutines ??
Post by: dfurlano on July 20, 2007, 08:05:35 AM
M98 P1002 L10 (M98 is the subroutine call command - P*********x is the subroutine name - Lxx tells it how many times)

Dan
Title: Re: G code subroutines ??
Post by: jimpinder on July 20, 2007, 09:17:50 AM
Thanks Dan - Yes - I ran off at the mouth again. I studied the forum and came up with the answer, but thanks anyway.