Hello Guest it is October 16, 2019, 11:53:13 PM

Author Topic: Nesting Subroutines?  (Read 3135 times)

0 Members and 1 Guest are viewing this topic.

Nesting Subroutines?
« on: January 01, 2007, 05:00:50 PM »
Is it possible?  The code below drops out after the first run of the internal subroutine.

(#1001 = X Axis)
(#1002 = A Axis)
(#1003 = A Axis Increment)

#1001=0
#1002=22.5
#1003=22.5


M98 P1002 L9
  O1002

    M98 P1001 L8
       O1001
       g0 x#1001 A#1003
       G73 z-.04 r.0 q.02 f3
       #1002=[#1003+45]
    M99


  #1001=[#1001+.333]
  #1003=[#1003+20]
M99

Offline Graham Waterworth

*
  • *
  •  1,889 1,889
  • Yorkshire Dales, England
    • View Profile
Re: Nesting Subroutines?
« Reply #1 on: January 01, 2007, 05:05:53 PM »
Should work like this

Graham.


(#1001 = X Axis)
(#1002 = A Axis)
(#1003 = A Axis Increment)

#1001=0
#1002=22.5
#1003=22.5
M98 P1002 L9
M30

O1002
M98 P1001 L8
#1001=[#1001+.333]
#1003=[#1003+20]
M99

O1001
g0 x#1001 A#1003
G73 z-.04 r.0 q.02 f3
#1002=[#1003+45]
M99
Without engineers the world stops
Re: Nesting Subroutines?
« Reply #2 on: January 01, 2007, 05:23:48 PM »
Graham you won! 

This program drills 8 holes equally spaced on a diameter and then increments over .333 in the X and offsets the holes 20 degrees 9 times.

Although my offer of one million dollars has expired let me offer a hearty "THANK YOU" for your expeditious response and expertise in helping me reach my goals!  Now back to work!

(#1001 = X Axis)
(#1002 = A Axis)
(#1003 = A Axis Increment)

#1001=0
#1002=22.5
#1003=0


M98 P1002 L9
M30
 
O1002
M98 P1001 L8
#1002=22.5
#1001=[#1001+.333]
#1003=[#1003+20]
M99

O1001
g0 x#1001 A[#1002+#1003]
G73 z-.04 r.0 q.02 f3
#1002=[#1002+45]
M99


Had a small change to the program to make it work properly.  Thanks again Graham.
« Last Edit: January 01, 2007, 06:27:57 PM by dfurlano »

Offline Graham Waterworth

*
  • *
  •  1,889 1,889
  • Yorkshire Dales, England
    • View Profile
Re: Nesting Subroutines?
« Reply #3 on: January 01, 2007, 07:44:43 PM »
I plant seeds and hope they flourish.

Graham.
Without engineers the world stops