Conditional and Loop Statements in Mach3


Results 1 to 6 of 6

Thread: Conditional and Loop Statements in Mach3

  1. #1
    Registered
    Join Date
    Feb 2010
    Location
    USA
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Conditional and Loop Statements in Mach3

    Hi All,

    I am pretty new to CNC and I am actually learning this stuff to help my father.

    I have used EMC2 a little bit and like it much better than the Kcam he started with.

    With EMC2 I can use conditional statements and while loops in my gCode using "O" words. I tried this with Mach3 trial version to no avail. Does the paid version of Mach3 Support looping and conditions. I did find in the manual the use of macros as subroutines. But no mention of conditional or looping statements.

    Thanks for your response.

    Similar Threads:


  2. #2
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    Not in the g-code. You can, though, create M code macros with if..then and while... loops and call them from the g-code. A bit more trouble, but it is doable.

    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)


  3. #3
    Registered
    Join Date
    Feb 2010
    Location
    USA
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default

    Can you give me an example? I know how to use M98/99 for macros but how do I use a macro for conditional and looping statements in Mach3.

    We are looking into purchasing Mach 3 with the mill add-ons. I like the fact that I can write VB extensions for it much like I write extensions for EMC2 using Php, C++, and Python. However, much of what my Dad is doing is easier done with loops and once in a while I find conditional statements to be handy.

    I can already tell Mach 3 is much better than KCam. I like EMC2 and it seems very powerful. But Dad can't see the screen very well and I don't have time to write a new UI for it right now. So Mach 3 seems to be the easiest route right now. It looks comparable to EMC2 as far as I can tell. What is your take on Mach 3 For beginners?

    Thank you again for your help.



  4. #4
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    You can use VB script in the macro, and assign it to any M code, like M555. When you call the M555 in your g-code, it'll run your VB script.

    Here's a lot of samples.
    http://www.machsupport.com/forum/ind...oard,75.0.html

    Mach3 for beginners? The main problem is that there's too much stuff on the screens that most beginners don't need. I use a greatly simplified screen that I made.
    http://www.machsupport.com/forum/ind...c,11115.0.html

    Other than that, it's very easy to use.

    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)


  5. #5
    Registered
    Join Date
    Feb 2010
    Location
    USA
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default

    Ok, I get it. I have to do it in VB and pass in the arguments from the gcode. That's kind of an odd solution. I would have thought that a program that looks as advanced as Mach3 would have support for loops and conditionals.

    Thank you for the info. You have been a great help!



  6. #6
    Registered vlmarshall's Avatar
    Join Date
    Mar 2006
    Location
    usa
    Posts
    474
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Monotoba View Post
    Ok, I get it. I have to do it in VB and pass in the arguments from the gcode. That's kind of an odd solution. I would have thought that a program that looks as advanced as Mach3 would have support for loops and conditionals.
    That's why I switched to EMC from Mach, every time I asked about a special G-code or function, the answer was always "do it yourself". With EMC, there are already a bunch of programmers doing just that... so I can stick to making parts.

    http://www.youtube.com/user/vlmarshall


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

Conditional and Loop Statements in Mach3

Conditional and Loop Statements in Mach3