585,582 active members*
3,783 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Haas Machines > Haas Mills > M97 local sub. keeps looping
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2016
    Posts
    3

    Question M97 local sub. keeps looping

    I'm starting to experiment with programming multiple work offsets using the M97 on my Haas OM2 and I keep getting stuck on my first sub program. It's probably just a matter of my syntax being slightly off:

    O10001(Base modification)
    G20 G90 G40
    T01 M06 (0.03" EM)
    G54
    S10000 M3
    G0 X0.2889 Y-0.1071
    G43 H01 Z1.
    M97 P12000
    /G55
    /M97 P12000
    /G56
    /M97 P12000
    /G57
    /M97 P12000
    /G58
    /M97 P12000
    /G59
    Z1.

    N12000
    ... (insert sub here)
    G0 Z1.
    M99

    G28 Z0 M5
    M9
    M01

    T02 M06 (0.01" EM)
    ...
    (N13000 on 6 locations to follow with 2nd tool)

    I think my problem lies in the placement of the M99, but I've tried switching it with an M02, and moving it within and outside of the sub. and it doesn't seem to make any difference. The machine just keeps looping back to G54 indefinitely.

    Any suggestions how I can continue to the G28 block would be much appreciated

  2. #2
    Join Date
    Jun 2015
    Posts
    119

    Re: M97 local sub. keeps looping

    Quote Originally Posted by smegma View Post
    /G59
    Z1.

    N12000
    ... (insert sub here)
    G0 Z1.
    M99

    G28 Z0 M5
    M9
    M01

    T02 M06 (0.01" EM)
    ...
    (N13000 on 6 locations to follow with 2nd tool)

    Unless you edited this to shorten the post, you need something like an M30 or a GOTO between the the Z1. line and the N12000 line, or it is just going to keep running the "subprogram" as an inline part of the main program. Since in that instance the M99 is not returning anywhere (as it would if there was an M97 or G65 call that sent the program to a subprogram), it will just jump to the head of the program (and loop endlessly).
    ____________________________
    My blog: http://www.fletch1.com

  3. #3
    Join Date
    Feb 2011
    Posts
    353

    Re: M97 local sub. keeps looping

    Fletch said it above




    O10001(Base modification)
    G20 G90 G40
    T01 M06 (0.03" EM)
    G54
    S10000 M3
    G0 X0.2889 Y-0.1071
    G43 H01 Z1.
    M97 P12000
    /G55
    /M97 P12000
    /G56
    /M97 P12000
    /G57
    /M97 P12000
    /G58
    /M97 P12000
    /G59
    Z1.
    G28 Z0 M5
    M9
    M01

    T02 M06 (0.01" EM)


    (end of tool call outs)
    M30(Place the m30 between tool call outs and sub routines)
    Your example above says to goto n12000 return to just after first m97 call then with the block deletes active it runs N12000 and return to the beginning of the program and start again


    N12000
    ... (insert sub here)
    G0 Z1.
    M99
    %

Similar Threads

  1. Looping
    By MikeB242 in forum G-Code Programing
    Replies: 7
    Last Post: 03-05-2018, 04:34 PM
  2. looping
    By Clyde_06 in forum Fanuc
    Replies: 2
    Last Post: 08-24-2014, 03:06 PM
  3. looping
    By dinglekiller in forum G-Code Programing
    Replies: 10
    Last Post: 02-01-2012, 05:47 AM
  4. M98 Looping
    By camtd in forum Parametric Programing
    Replies: 20
    Last Post: 08-15-2011, 02:43 PM
  5. Sub Looping
    By murphyspost in forum Daewoo/Doosan
    Replies: 8
    Last Post: 12-27-2006, 05:28 PM

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
  •