Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: skartalov on November 25, 2011, 09:57:57 AM

Title: Macro integration problem
Post by: skartalov on November 25, 2011, 09:57:57 AM
Hi,

I have machine, that will drill holes, so it only uses X axis, and the drill is performed by pneumatic valve, that has sensors for up, and down positions.
I mapped them as INPUT1 and INPUT2.
The valve actuator is mapped to OUTPUT2.

So I wrote macro, (filename M123.M1S):
---------------------------------------------------------------
ActivateSignal(OUTPUT2)
while IsActive(INPUT2)=false
sleep(100)
wend
DeactivateSignal(OUTPUT2)
while isActive(INPUT1)=false
sleep(100)
wend
---------------------------------------------------------------

And the main g-code program looks like this:
---------------------------------------------------------------
m3
g0x100
m123
g0x150
m123
g0x300
m123
g0x350
m123
g0x500
m123
g0x550
m123
g0x0
m30
---------------------------------------------------------------

Basically, it works fine, but the problem is when I first load the g-code, mach3 starts to "Please wait. Generating path...", and hangs-up!

if I cancel it, then press e-stop, then release E-stop, somehow I am in the game, so I can start using this code.

So my question is why is that happening, and how to avoid it?

Thanks!
Title: Re: Macro integration problem
Post by: ger21 on November 25, 2011, 10:30:27 AM
Try this:

In General Config, in the General Configuration section, check the box "Ignore M Calls While Loading".
Title: Re: Macro integration problem
Post by: skartalov on November 28, 2011, 01:00:04 PM
Thanks a lot! Now it is ok!