535,633 active members*
4,025 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Registered
    Join Date
    Apr 2015
    Posts
    19

    Custom macro help.

    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

  2. #2
    Registered
    Join Date
    Apr 2005
    Posts
    227

    Re: Custom macro help.

    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.

  3. #3
    Registered
    Join Date
    Apr 2015
    Posts
    19
    Quote Originally Posted by ZASto View Post
    It is a NO-NO calling a macro within a macro. It just does not work.
    I think in trying to call macro from gcode though. Is that the same as a macro from a macro?


    Thanks

  4. #4
    Registered
    Join Date
    Mar 2009
    Posts
    1395

    Re: Custom macro help.

    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...

  5. #5
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    35291

    Re: Custom macro help.

    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
    http://www.thecncwoodworker.com/2017.html

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

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

Similar Threads

  1. Replies: 2
    Last Post: 12-19-2012, 01:28 PM
  2. Replies: 3
    Last Post: 02-13-2012, 07:20 PM
  3. Custom Macro Containing G65
    By LostInMacro in forum Fanuc
    Replies: 20
    Last Post: 09-15-2010, 09:21 PM
  4. "difference between Custom Macro A and Custom Macro B"
    By arulthambi in forum Parametric Programing
    Replies: 4
    Last Post: 10-05-2009, 09:34 PM
  5. Custom macro!!!!
    By chrisryn in forum G-Code Programing
    Replies: 4
    Last Post: 05-28-2008, 04:13 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •