It is a NO-NO calling a macro within a macro. It just does not work.
Hey everyone, I have a mach3 custom macro question.
I am trying to create a macro that I can call through gcode that will automatically load and start a new gcode file.
I my script works perfectly if I run it from the vbscript editor or if I create a button that runs it in mach3. But if I try to type the mcode into mdi it starts to load the gcode but it gets stuck on the "generating toolpath" window.
So if I type in M997, my custom macro, it doesn't work. But if I make it as a button it does load a gcode file and automatically starts my gcode?
This is what my code looks like
LoadFile "gcode.txt"
While IsLoading()
Wend
runfile()
And to give more details on what I am trying to do, because maybe there is another solution.
My machine is a 4x8 router that has automatic sheet loading and material push off for when finished. I am trying to set it up where I have a a custom post processor for when I want the machine to keep cutting the same file on multiple sheets.
My current method is, run the gcode cut file at the end of the file it runs a custom macro that turns off the vacuum table and clears the cut parts on to the conveyor belt. Then I need the machine to load and start a new gcode to sweep the table with the routers dust brush. (That's where my first problem is) after it is swept it will run my auto load macro that grabs a sheet and places it on the spoilboard. That part works fine, but then I need it to load another gcode file and start that cut.
Sorry if that's too much or not enough information ????
Thanks for the help,
Mike
Similar Threads:
Last edited by MikeCaffey; 01-04-2021 at 12:51 AM.
It is a NO-NO calling a macro within a macro. It just does not work.
Make no mistake between my personality and my attitude.
My personality is who I am. My attitude depends on who you are.
calling macro from G-code is correct. Your explanation is a bit messy. I still don't understand, where the problem is. If You are able to define customer macro, do as many macros as you need and call them one-by-one from Your G-code...
If you try to run a g-code file from within a g-code file, you'd be trying to run two files at the same time. Not going to work.
What you probably want to do is run the second file as a subroutine. I think you can call an external file as a sub, but it's been a long time and don't recall exactly.
Gerry
UCCNC 2017 Screenset
[URL]http://www.thecncwoodworker.com/2017.html[/URL]
Mach3 2010 Screenset
[URL]http://www.thecncwoodworker.com/2010.html[/URL]
JointCAM - CNC Dovetails & Box Joints
[URL]http://www.g-forcecnc.com/jointcam.html[/URL]
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)