1
General Mach Discussion / M98 subroutine L-word doesn't call subroutine correct number of times
« on: November 24, 2009, 04:13:11 PM »
I have a program with the line "M98 P2 L2". It should call subroutine O2, two times. However, it calls the subroutine 4 times. Has anyone every seen this? I originally had "M98 P2 L12" - I stopped the program after the subroutine was called 17 times. I then changed the L word to L2 to see what would happen and now it calls 4 times. I upgraded to the latest stable version, R3.042.032, but no change in behavior. I am running Win XP and the machine is an IH CNC mill. Here's the whole program:
G0 Z5
G0 x-24 y9.24
g0 z0
M98 P2 L2
g0 z5
M30
(O1 - drill bolt hole)
O1
F50
G0 Z1
G1 Z-24
G0 Z5
M99
(O2 - cut out clear area for bolt head, x- y+)
O2
F100
g91
g1 z-1
g90
G0 x-24 y9.24
g1 x-9.24
g1 y24
g1 x-14.24
g1 y14.24
g1 x-24
g1 y19.24
g1 x-19.24
g1 y24
g1 x-21
g1 y21
g1 x-24
g0 y9.24
m99
G0 Z5
G0 x-24 y9.24
g0 z0
M98 P2 L2
g0 z5
M30
(O1 - drill bolt hole)
O1
F50
G0 Z1
G1 Z-24
G0 Z5
M99
(O2 - cut out clear area for bolt head, x- y+)
O2
F100
g91
g1 z-1
g90
G0 x-24 y9.24
g1 x-9.24
g1 y24
g1 x-14.24
g1 y14.24
g1 x-24
g1 y19.24
g1 x-19.24
g1 y24
g1 x-21
g1 y21
g1 x-24
g0 y9.24
m99