Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 09:13:37 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  Macro integration problem
Pages: 1   Go Down
Print
Author Topic: Macro integration problem  (Read 165 times)
0 Members and 1 Guest are viewing this topic.
skartalov
Active Member

Offline Offline

Posts: 20


View Profile
« 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!
Logged
ger21
Global Moderator
*
Online Online

Posts: 2,619



View Profile WWW
« 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".
Logged

skartalov
Active Member

Offline Offline

Posts: 20


View Profile
« Reply #2 on: November 28, 2011, 01:00:04 PM »

Thanks a lot! Now it is ok!
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!