Hello Guest it is December 12, 2024, 03:29:13 PM

Author Topic: Macro integration problem  (Read 4184 times)

0 Members and 1 Guest are viewing this topic.

Macro integration problem
« 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!

Offline ger21

*
  • *
  •  6,295 6,295
    • The CNC Woodworker
Re: Macro integration problem
« Reply #1 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".
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Macro integration problem
« Reply #2 on: November 28, 2011, 01:00:04 PM »
Thanks a lot! Now it is ok!