Haas reads past macro argument in m98 sub call
Close
Login to Your Account
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2019
    Country
    UNITED STATES
    State/Province
    Ohio
    Posts
    2
    Post Thanks / Like
    Likes (Given)
    2
    Likes (Received)
    0

    Default Haas reads past macro argument in m98 sub call

    I am using a Haas 2009 vf3 mill with a DS30-SSY

    I'm having an issues where the macro argument reads past the Z level argument to end last z move. It will not move the next line of code, and continues to go back to the N100 line. This code is embedded in a sub call. I have written many helical milling macros much like the one below all on Fanuc based machines and had no issues. On a HAAS is there conflict with using M98 P#### calls being it may want to loop back with the look ahead?
    %
    O7001(HELICAL MILL+CBORE)


    #640= 0.927 (PIN HOLE SIZE)
    #641= -1.36 (COMPRESSION DISTANCE VALUE)
    #642= 3.917 (PISTON MAJOR O.D. VALUE)
    #643= 2.865 (LOCK RING DISTANCE)
    #644= 0.073 (LOCK RING TOOL WIDTH)
    #645= 1.007 (LOCK RING DIAMETER)
    #646= 1.250 (PIN BOSS SPACING)
    #647= 2.75 (PIN LENGTH)
    #648= 3.130 (OUTSIDE PIN BOSS)

    N778
    #630= [ [ #642 / 2 ] + 0.1 ] (Z CLEARANCE PLANE)
    #631= [ #642 / 2 ] (Z INITIAL CUT)
    #632= [ [ #643 / 2 ] - #644 ] (1RST LOCK RING Z VALUE)
    #633= [ #643 / 2 ] (2ND LOCK RING Z VALUE)
    #634= [ [ #645 - #638 ] / 2 ] (LOCK RING DIA. VALUE)
    #635= [ [ #643 / 2 ] + 0.09 ] (Z VALUE FOR CONTOUR BORES)
    #636= [ [ COS[ 45 ] ] * [ #640 / 2 ] ] (LOCATION FOR THE REMOVAL NOTCH)
    #637= [ [ #643 / 2 ] - 0.0937 ] (Z VALUE FOR NOTCH TOOL)
    (#638-DIAMETER ARGUMENT FOR LOCKRING DIAMETERS)

    #604=[[#648-#647]/2]]
    #606=#640-#605
    #607=#606/2
    #611=[#604+.05]

    N1000
    X#601Y#602
    G1Z#630F25.0
    N100
    G1Y#607 D23 F50.0
    G2J-#607 Z#631
    #631=[#631-.03]
    IF[#631GE#604]GOTO100
    G1Y#602
    G00Z#630

    IF[#651EQ0]GOTO2100

    N2000
    X#601Y#602
    G1Z#630F25.0
    N200
    G1Y[#607-.005] D23 F50.0
    G2J-[#607-.005] Z#635
    #631=[#631-.03]
    IF[#631GE#635]GOTO200
    G1Y#602
    G00Z#630

    N2100
    M99
    %

  2. #2
    Join Date
    Sep 2006
    Location
    Long Island, New York
    Posts
    660
    Post Thanks / Like
    Likes (Given)
    276
    Likes (Received)
    104

    Default

    I add a G103 P1 to limit the look ahead while I run the macro, then a G103 after the macro but before the machining to reset the look ahead.

  3. Likes nrj38 liked this post
  4. #3
    Join Date
    Dec 2019
    Country
    UNITED STATES
    State/Province
    Ohio
    Posts
    2
    Post Thanks / Like
    Likes (Given)
    2
    Likes (Received)
    0

    Default

    Would this be the right approach adding it in the sub


    %
    O07001 (HELICAL MILL)
    #640= 0.927 (PIN HOLE SIZE)
    #641= -1.36 (COMPRESSION DISTANCE VALUE)
    #642= 3.917 (PISTON MAJOR O.D. VALUE)
    #643= 2.865 (LOCK RING DISTANCE)
    #644= 0.073 (LOCK RING TOOL WIDTH)
    #645= 1.007 (LOCK RING DIAMETER)
    #646= 1.250 (PIN BOSS SPACING)
    #647= 2.75 (PIN LENGTH)
    #648= 3.130 (OUTSIDE PIN BOSS)

    N778
    #630= [ [ #642 / 2 ] + 0.1 ] (Z CLEARANCE PLANE)
    #631= [ #642 / 2 ] (Z INITIAL CUT)
    #632= [ [ #643 / 2 ] - #644 ] (1RST LOCK RING Z VALUE)
    #633= [ #643 / 2 ] (2ND LOCK RING Z VALUE)
    #634= [ [ #645 - #638 ] / 2 ] (LOCK RING DIA. VALUE)
    #635= [ [ #643 / 2 ] + 0.09 ] (Z VALUE FOR CONTOUR BORES)
    #636= [ [ COS[ 45 ] ] * [ #640 / 2 ] ] (LOCATION FOR THE REMOVAL NOTCH)
    #637= [ [ #643 / 2 ] - 0.0937 ] (Z VALUE FOR NOTCH TOOL)
    (#638-DIAMETER ARGUMENT FOR LOCKRING DIAMETERS)

    #631=ROUND[#631]

    #629=#631

    #604= [ [ #648 - #647 ] / 2 ]
    #606= #640 - #605
    #607= #606 / 2
    #611= [ #604 + 0.05 ]
    #651=1

    G103P1(TURN LOOK AHEAD OFF)

    G01 Z#630
    N10
    X#601 Y#602
    G01 Z#631 F25.
    G01 Y#607 F50.

    N100
    G02 J - #607 Z#631
    #631= [ #631 - 0.03 ]
    IF [ #631 LT #611 ] GOTO200
    IF [ #631 GE #611 ] GOTO100
    N200 G02 J - #607 Z#611

    G01 Y#602
    G00 Z#630

    IF [ #651 EQ 0 ] GOTO2100

    N20
    X#601 Y#602
    G01 Z#630 F25.
    N200
    Z#635
    G01 Y [ #607 + 0.0025 ] F50.
    G02 J - [ #607 + 0.0025 ]
    G02 J - [ #607 + 0.0025 ]
    G01 Y#602
    G00 Z#630

    N2100
    G103(TURN LOOK AHEAD ON)

    M99
    %

  5. #4
    Join Date
    Sep 2006
    Location
    Long Island, New York
    Posts
    660
    Post Thanks / Like
    Likes (Given)
    276
    Likes (Received)
    104

    Default

    Here's a sample from the last one I did.

    I did the G103 P1 right where the program enters the macro, and turned it off once it got to machining

    Code:
    N1 
    G103 P1 (LIMIT LOOK AHEAD FOR MACRO TO WORK) 
    
    (-- MACHINE WON'T GRAPH WITH M109'S --) 
    (UNCOMMENT NEXT LINE TO WATCH BACKPLOT ON SCREEN) 
    (GOTO2) 
    
    (***************************************)
    (CLEAR THE VARIABLES) 
    (***************************************)
    #501= 0 (1ST CHARACTER VARIABLE)
    #502= 0 (2ND)
    #503= 0 (3RD)
    #516= 0 (Y/N INPUT FLAG)
    (***************************************)
    
    
    (***************************************)
    (GET USER INPUT) 
    (***************************************)
    M109 P501 (MILL 1ST [#1-1 or P]) 
    M109 P502 (MILL 2ND [#0-9 or H])
    M109 P503 (MILL 2ND [#A-T]) 
    (***************************************)
    
    
    (***************************************)
    (LET USER VERIFY INPUT AND RUN)
    (***************************************)
    M97 P101 (SUBROUTINE TO VERIFY 1ST NUMBER INPUT) 
    M97 P201 (2ND LETTER INPUT) 
    M97 P301 (3RD)
    
    (LET USER CHANGE THEIR MIND) 
    M109 P516 (Cycle Start[Y] / Start Over[N] - [Y/N]) 
    
    (GO BACK TO BEGINING IF ANSWER) 
    (IS ANYTHING BUT 'Y') 
    IF [ #516 NE 89 ] GOTO1 
    (***************************************)
    
    
    (***************************************)
    (MAIN)
    (***************************************)
    N2
    G40 G80 G17 
    
    
    
    (GET PROBE AND ADJUST FOR)
    (PART THICKNESS)
    T21 M6
    G53 G90 G0 X-5.64 Y-7.64
    G53 G01 Z-9.9 F400.
    
    G65 P9995 W54. A20. H-.3
    (CHANGE OTHER FIXTURE HEIGHTS TO NEW G54 HEIGHT)
    #5283=#5223 (G57 Z = G54 Z)
    #5263=#5223 (G56)
    #5243=#5223 (G55)
    
    
    
    T1 M6 (5/64" CARBIDE 4 FLUTE STUB)
    M03 S8000 
    
    (REACTIVATE LOOK AHEAD) 
    G103 
    
    M08
    (1ST NUMBER) 
    G55 
    M98 P#501

  6. #5
    Join Date
    Sep 2006
    Location
    Long Island, New York
    Posts
    660
    Post Thanks / Like
    Likes (Given)
    276
    Likes (Received)
    104

    Default

    Wherever your program enters the sub, I would have the G103 P1 be the first thing it reads.


Tags for this Thread

Bookmarks

Posting Permissions

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