Hello Guest it is April 19, 2024, 10:12:33 PM

Author Topic: Add code after a M98 subroutine (newbie)  (Read 2298 times)

0 Members and 1 Guest are viewing this topic.

Add code after a M98 subroutine (newbie)
« on: August 12, 2014, 10:25:26 PM »
Hi there,

I'd like to use some code after a M98 subroutine, but Mach3 simply doesn't read the code at the end of the loop and just stops the program instead.
I did some research and never read it was impossible to do so but I didn't see examples with some code following a subroutine neither...

Here is my code:

%
O01 (MAIN PROGRAM)

F5000
S60
(G0 X0.000000 Y0.000000 Z0.000000)


   G1 X-4.4 Y25   
   G1 X4.3 Y25   
   G1 X-4.3 Y20   
   G1 X4.3 Y10   
   G1 x-5.7   
   G1 Z1.02777   
   G1 x5.8


M98 P02 L31
M30
O02

   G1 X-4.7 Y25   
   G1 X4.7 Y25   
   G1 X-4.7 Y20   
   G1 X4.7 Y10   
   G1 x-5.8   
   G1 Z1.027777   
   G1 x5.8         

M99

(so Mach3 doesn't read the following part:)
   G1 X-4.7 Y25      
   G1 X4.7 Y25   
   G1 X-4.7 Y20   
   G1 X4.7 Y10   
   G1X-5.8   
%


Is there any solution?

Thanks, Luc  (Sorry for my english I'm french  :) )
Re: Add code after a M98 subroutine (newbie)
« Reply #1 on: August 13, 2014, 06:59:27 AM »
The SUB must be outside of the main program.
More like this:
%
O01 (MAIN PROGRAM)

F5000
S60
(G0 X0.000000 Y0.000000 Z0.000000)


   G1 X-4.4 Y25   
   G1 X4.3 Y25   
   G1 X-4.3 Y20   
   G1 X4.3 Y10   
   G1 x-5.7   
   G1 Z1.02777   
   G1 x5.8


M98 P02 L31
G1 X-4.7 Y25     
   G1 X4.7 Y25   
   G1 X-4.7 Y20   
   G1 X4.7 Y10   
   G1X-5.8   
M30


O02
   G1 X-4.7 Y25   
   G1 X4.7 Y25   
   G1 X-4.7 Y20   
   G1 X4.7 Y10   
   G1 x-5.8   
   G1 Z1.027777   
   G1 x5.8         

M99

Russ