Need Help! Custom macro help.


Results 1 to 5 of 5

Thread: Custom macro help.

  1. #1

    Default 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

    Similar Threads:
    Last edited by MikeCaffey; 01-04-2021 at 12:51 AM.


  2. #2
    Member ZASto's Avatar
    Join Date
    Apr 2005
    Location
    Vanuatu
    Posts
    304
    Downloads
    3
    Uploads
    0

    Default 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

    Default

    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
    Member Algirdas's Avatar
    Join Date
    Mar 2009
    Location
    United Arab Emirates
    Posts
    1982
    Downloads
    2
    Uploads
    0

    Default 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
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default 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
    [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)


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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Custom macro help.

Custom macro help.