586,096 active members*
3,510 visitors online*
Register for free
Login
Results 1 to 3 of 3
  1. #1

    Help with calling a subroutine

    I am trying to set up a subroutine to drill a small hole at each location in a set of coordinates. Below is a sample of how I've set it up. Then I run the G-code, the Z comes down, goes up, then fails to continue with the program.

    What am I doing wrong? Please rewrite it correctly so that I can understand and learn from my mistakes.

    Thanks,

    Charlie

    G90 G20
    G0 X0.0 Y0.0 Z.1
    M98 P1
    X0.5 Y0.0
    M98 P1
    X1.0 Y0.0
    M98 P1
    M2
    O1
    G1 F30 Z-.2
    G0 Z.1
    M99

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    Make sure the M99 is shown in the g-code window.

    I copied your code into Notepad and saved it. When loaded into Mach3, the M99 wasn't there. To fix it, go into notepad, place the cursor after the M99, and hit "enter". Then save, and the M99 should appear in Mach3. Once I did that, it ran fine.
    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)

  3. #3
    Thanks so much Gerry,
    I had noticed that the M99 didn't show up in Mach 3; but, being a novice, I thought it was a charactistic of the M command. It is reassuring to know that I actually set it up correctly from reading the manual. I'll try it again in the shop tomorrow.

    Charlie

Similar Threads

  1. trying to call a subroutine
    By hindocarina in forum G-Code Programing
    Replies: 4
    Last Post: 02-12-2007, 03:01 AM
  2. Calling All Richmonders!
    By Robyn in forum Trade Shows / Webinars / Other Events
    Replies: 0
    Last Post: 06-05-2006, 01:24 PM
  3. Need help with a subroutine formulae...
    By Darc in forum G-Code Programing
    Replies: 2
    Last Post: 01-10-2006, 12:05 AM
  4. Need help with subroutine
    By 2_jammer in forum Uncategorised CAM Discussion
    Replies: 1
    Last Post: 01-18-2005, 05:46 AM

Posting Permissions

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