Hello Guest it is April 19, 2024, 11:37:23 AM

Author Topic: G code subroutines ??  (Read 6582 times)

0 Members and 1 Guest are viewing this topic.

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
G code subroutines ??
« 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 ???
Not me driving the engine - I'm better looking.
Re: G code subroutines ??
« Reply #1 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

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: G code subroutines ??
« Reply #2 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.
Not me driving the engine - I'm better looking.