Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: jet8300 on August 17, 2021, 08:04:22 PM

Title: Gcode pauses after macro
Post by: jet8300 on August 17, 2021, 08:04:22 PM
So I created a macro on my Mach3 machine that does what I want when I run the script in the script editor. I added the macro to a test gcode file and when I run it, the machine does run the macro but won't move past that.

I've searched a bunch but haven't found anything helpful yet.
Title: Re: Gcode pauses after macro
Post by: Graham Waterworth on August 22, 2021, 02:15:36 PM
Posting a copy of the macro will help.
Title: Re: Gcode pauses after macro
Post by: jet8300 on September 03, 2021, 11:59:43 AM
I have attached my macro.

Pressing start again after the macro completes does get the machine moving again, but I would like this to be automatic.
Title: Re: Gcode pauses after macro
Post by: Tweakie.CNC on September 03, 2021, 01:25:44 PM
Try adding the line

DoOEMButton(1000)

to the end of your macro then save the change. This should make it automatic.

Tweakie.
Title: Re: Gcode pauses after macro
Post by: jet8300 on September 03, 2021, 01:48:50 PM
Hah, I should have thought of that. Thank you for your help!
Title: Re: Gcode pauses after macro
Post by: jet8300 on September 09, 2021, 12:47:29 PM
So adding DoOEMButton(1000) just causes the macro to act like it was skipped over. The machine does not do what the macro is supposed to do and it just moves on with the next lines of code.
Title: Re: Gcode pauses after macro
Post by: Tweakie.CNC on September 09, 2021, 10:11:35 PM
Add the lines

While IsMoving ()
Wend

After your macro instructions but just before the line

DoOEMButton(1000)

Tweakie.
Title: Re: Gcode pauses after macro
Post by: jet8300 on September 12, 2021, 12:36:31 PM
I REALLY appreciate your help with this, but it's still not working correctly. :-(
Title: Re: Gcode pauses after macro
Post by: Tweakie.CNC on September 12, 2021, 10:29:31 PM
Try the attached script ( I removed some spaces ). After downloading, rename the file accordingly.

Tweakie.
Title: Re: Gcode pauses after macro
Post by: jet8300 on September 17, 2021, 05:05:05 PM
Sadly, this still doesn't work.

I have also tried G28.1 in various configurations and it does the same thing. References as it should and just stops after. Clicking start again makes the machine proceed.

I'm going to set it up this way and just force our operators to click the button twice. At least this way I know they are homing every time.

Putting together a vacuum system this weekend to hopefully eliminate lost step issues.
Title: Re: Gcode pauses after macro
Post by: Graham Waterworth on September 17, 2021, 08:11:10 PM
Your macro is homing 4 axis and only zeroing out 3 of them, do you have 4 axis?

Have you put messages in the macro to see where it fails, is it waiting for an axis to home?

Maybe take out the A axis home button.

Title: Re: Gcode pauses after macro
Post by: jet8300 on September 17, 2021, 08:31:44 PM
The A axis is the slave for the x axis. I copied the original code from my reference all button code, which works. I will try removing it.

I don't know how to put in messages.

If I remember correctly, it does say something about the A axis in the message bar.
Title: Re: Gcode pauses after macro
Post by: Graham Waterworth on September 18, 2021, 03:45:32 PM
You just add a line like this :-

Message "I am here"