Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: vypham2 on June 22, 2012, 04:58:50 PM

Title: Can Mach3 do continuous loops?
Post by: vypham2 on June 22, 2012, 04:58:50 PM
Hi all,

I'm starting to get to know the machine at a basic level.

Does anyone know if there's a gCode that can program the Mach3 to do continuous loops over and over again once i've put in a design layout?

Thanks,
V
Title: Re: Can Mach3 do continuous loops?
Post by: Captain Midnight on June 22, 2012, 06:00:16 PM
Write a subrutine, and call it as many times as you wish.
Title: Re: Can Mach3 do continuous loops?
Post by: BR549 on June 23, 2012, 05:09:04 PM
THE sub DOES have a 99 loop max.

(;-) TP
Title: Re: Can Mach3 do continuous loops?
Post by: Overloaded on June 23, 2012, 08:22:40 PM
True continuous, M47 at the end of the code, Rewind and Restart. But it will run forever, you have to stop it.
I used it to verify a set-up, let it run for 48 hours with a small program.

TP, what about a sub in a sub ?  99 x 99 ? ? ?

Russ
Title: Re: Can Mach3 do continuous loops?
Post by: BR549 on June 24, 2012, 11:35:07 AM
Russ, Correct(;-)

(;-) TP
Title: Re: Can Mach3 do continuous loops?
Post by: derekbpcnc on June 24, 2012, 12:01:21 PM
or use a variable counter.

N10 #100 =1
N20 M98 O1 (RUN  SUB)
N30 IF [#100LT300] GOTO 20    (LOOPS SET TO 300 OR WHETEVER YOU NEED)
N40 M30

IN THE SUB INCREMENT COUNTER #100=[#100+1]
Title: Re: Can Mach3 do continuous loops?
Post by: BR549 on June 24, 2012, 12:13:26 PM
SORRY but mach3 does NOT have conditional Gcode.

(;-)TP
Title: Re: Can Mach3 do continuous loops?
Post by: Hal on June 24, 2012, 08:50:04 PM
What would happen with M47?
Title: Re: Can Mach3 do continuous loops?
Post by: Overloaded on June 25, 2012, 08:32:19 AM
What would happen with M47?

"M47- Repeat program from first line"
It would loop continuously ..... until you defaulted on your electric bill.  :)

Russ
Title: Re: Can Mach3 do continuous loops?
Post by: vypham2 on June 25, 2012, 11:11:03 AM
Thanks guys!
Only one thing though, when I put the subroutine in microsoft notepad and save it as .tap/AllFiles... it doesn't show up as a subroutine on my Program Run scroll box and doesn't perform the function because essentially there isn't one.
Help?
V
Title: Re: Can Mach3 do continuous loops?
Post by: Hal on June 25, 2012, 02:11:55 PM
needs to be <filename.tap>. The name should be the same as in the sub-call.

Hal