Hello Guest it is March 28, 2024, 05:14:45 AM

Author Topic: Infinite Loop  (Read 3641 times)

0 Members and 1 Guest are viewing this topic.

Infinite Loop
« on: July 31, 2014, 04:07:33 AM »
Dear Mach-users,
I use Mach3 for 4 weeks. Never hear about G-code before.
I`m looking for an infinite loop. I had found some questions about at some fora, but without any answer. Is it impossible?
Of course works the follow Code properly for example:

O0001
G00   X20
M98 P2 L3 (call sub 3 times)
M30

O0002
G00   Y5
G00   X8
G00   Y0
G00   X0
M99

But it isn't an infinite loop.
Then I try the follow VB-script:

Sub CheckPins
      While IsActive(Input3)
       Code "g00 y1 x1"
       Code "g00 y0 x0"
       Wend   
End Sub 
         
It runs properly if call by M... But it looks to Input3 by start only and doesn`t stop if Input3 is low (also not if call M... again with Input3 low). If I put this script to MacroPump, I got the error Code 3336 and 9991. Where can I get a list of this error messages? By the way the same will happen if start the script by the VB-editor. Only call with M... is possible.
How can I stop the loop if an Input is low?
Thanks.

Best regards
CNCwelder
Re: Infinite Loop
« Reply #1 on: January 03, 2015, 08:30:13 AM »
Hi


%
g01 X0 F8000
X200
X-200
G04 P200
M47 (powtarza program bez przerwy)
%