Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: KipKirol on July 11, 2018, 02:56:16 PM

Title: Problem with M30 at end of program
Post by: KipKirol on July 11, 2018, 02:56:16 PM
I would like an M30 at the end of my programs to rewind the program.

Below is a simple code I wrote, the M30 rewinds to program:

G21 G0 G17 G40 G49 G80 G90                  
G0 G90 Z35                  
T1 M6                  
G54     S   3250   M3
G0 Y0
G0 Y-70
G0 Z10
G1 Z3 F 1000
G1 Y-45 Z0
G1 Y 2070 F2000
G0 Z30   
M5
G0 Z-.1                  
M30


Below is header and footer from a similar program that does not rewind.

G21                           
G90                           
G53         Z   0               
T1 M6                           
G0 G90 G54   Y   -60                     
S   3250   M3
G43 H1         Z   15               
G1                F   250   

(program)

G0    Y   1810                     
M5                           
G0          Z   99               
G0    Y   2200                     
G53          Z   0               
M30   





Any idea why the M30 does not pickup in the second program?

   

   
Title: Re: Problem with M30 at end of program
Post by: ger21 on July 11, 2018, 03:37:03 PM
Put your cursor behind, it, hit the Enter key, and then save it.

Mach3 won't see it if there's no CR after it.
Title: Re: Problem with M30 at end of program
Post by: KipKirol on July 11, 2018, 04:22:29 PM
This fixed the program, thanks!

Since the second code was created in Excel I just added a period to the line below the M30 and the program now rewinds.