Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: CharliePatten on August 17, 2010, 07:43:14 AM

Title: need help w/ subroutine
Post by: CharliePatten on August 17, 2010, 07:43:14 AM
How do I create a subroutine program for

M8M9
G4P.25

that is repeated many times thruout a program?
Title: Re: need help w/ subroutine
Post by: BR549 on August 17, 2010, 08:04:22 PM
There are several ways to do it.    One is too call the sub from inside the Gcode program . The other way is to call it from  the macro directory


G98 P1 L1              Calls the sub from inside the program.



o1                     This would be the sub code included at the end of the program
M8 M9
G4 P0.25
M99
%


M98 (Name of sub.tap)   would call the sub from the macro directory


'Name of sub.tap               This would be the sub program stored in the macro directory under the name of "Name of Sub.tap"
M8 M9
G4 P0.25
M99
%

Hope that helps,   (;-)