585,949 active members*
4,012 visitors online*
Register for free
Login Register
HEIDENHAIN Forum
G-Code Programing > Custom macro!!!!
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Posts
    153

    Talking Custom macro!!!!

    Can some one look at this and see if it should work.
    Its in incremental because before the call the main program will center the tool to the hole. This is to bore all size holes 2 and above. I could be way off but it looks like it will work. The machine is running production so I can't test.

    %9003 (BORE PROGRAM)
    (PROGRAMED BY CMR)
    (CALL G65 P9003 T13 D4.25 Z-1.88 A.3 F140.
    #127=#7 (HOLE DIAMETER)
    #132=#26 (Z DEPTH)
    #131=#1 (Z INCREMENT)
    #135=#9 {FEEDRATE)
    IF [#127 EQ #0] GOTO 98(HOLE DIAM MISSING GENERATE ALARM)
    IF [#131 EQ #0] GOTO 98 (Z DEPTH INCREMENT MISSING GENERATE ALARM)
    IF [#132 EQ #0] GOTO 98 (DEPTH MISSING)
    IF [#135 EQ #0] GOTO 98 (FEED RATE MISSING)
    IF [#20 EQ #0) GOTO 98 (TOOL MISSING)
    #133=FUP[#132/#131]
    #134=#132/#133 (NEW Z INCREMENT)
    #129=#127/2 {SETS RADIUS)
    IF [#129 LT 1.5] GOTO 97 (BORE TO SMALL GENERATE ALARM)
    G91
    G0 Y[#129-1.]
    G01 G42 D#20 X-1. F#135
    G02 X1. Y1. R1.
    #130=1
    N1 IF [#130 GT #133] GOTO 10
    Y-#127 R#129
    Y#127 R#129
    Z#134
    #130=#130+1
    GOTO 1
    N10 X1.Y1. R1.
    G28Z0
    G28YO
    G90
    M99
    N97 #3000=200(BORE TO SMALL)
    N98 #3000=201(DATA MISSING IN CALL)
    %

    Edit: left out a line.
    No matter how good you are, there is always someone better!!!

  2. #2
    Join Date
    May 2007
    Posts
    1003
    "{" is mistyped in #135=#9 {FEEDRATE) & #129=#127/2 {SETS RADIUS).

    Shouldn't IF [#129 LT 1.5] GOTO 97 (BORE TO SMALL GENERATE ALARM)
    be IF [#29 LT 1] for holes greater than 2 bore size?

    Can't say for the rest as I only program lathes. I would like to know your reasoning behind setting #1, #7, #9, & #26 equal to a different variable number.

    Thanks.

    P.S. Question not meant as sarcasm or any other negative. Just trying to learn.

  3. #3
    Join Date
    Mar 2006
    Posts
    153
    Quote Originally Posted by g-codeguy View Post
    "{" is mistyped in #135=#9 {FEEDRATE) & #129=#127/2 {SETS RADIUS).

    Shouldn't IF [#129 LT 1.5] GOTO 97 (BORE TO SMALL GENERATE ALARM)
    be IF [#29 LT 1] for holes greater than 2 bore size?

    Can't say for the rest as I only program lathes. I would like to know your reasoning behind setting #1, #7, #9, & #26 equal to a different variable number.

    Thanks.

    P.S. Question not meant as sarcasm or any other negative. Just trying to learn.
    Im not sure why I made the equal to different variables. I notice the typo. the #29 variable doesn't exist I am checking the results of #129=#127/2
    No matter how good you are, there is always someone better!!!

  4. #4
    Join Date
    Mar 2006
    Posts
    153
    Here is edited program.

    %9003 (BORE PROGRAM)
    (PROGRAMED BY CMR)
    (CALL G65 P9003 T13 D4.25 Z-1.88 A.3 F140.
    (#7 HOLE DIAMETER)
    (#26 Z DEPTH)
    (#1 Z INCREMENT)
    (#9 FEEDRATE)
    (#20 TOOL)
    IF [#7 EQ #0] GOTO 98(HOLE DIAM MISSING GENERATE ALARM)
    IF [#1 EQ #0] GOTO 98 (Z DEPTH INCREMENT MISSING GENERATE ALARM)
    IF [#26 EQ #0] GOTO 98 (DEPTH MISSING)
    IF [#9 EQ #0] GOTO 98 (FEED RATE MISSING)
    IF [#20 EQ #0) GOTO 98 (TOOL MISSING)
    #133=FUP[#26/#1]
    #134=#26/#133 (NEW Z INCREMENT)
    #129=#7/2 (SETS RADIUS)
    IF [#129 LT 1.5] GOTO 97 (BORE TO SMALL GENERATE ALARM)
    G91
    G0 Y[#129-1.]
    G01 G42 D#20 X-1. F#9
    G02 X1. Y1. R1.
    #130=1
    N1 IF [#130 GT #133] GOTO 10
    Y-#7 R#129
    Y#7 R#129
    Z#134
    #130=#130+1
    GOTO 1
    N10 X1.Y1. R1.
    G28Z0
    G28YO
    G90
    M99
    N97 #3000=200(BORE TO SMALL)
    N98 #3000=201(DATA MISSING IN CALL)
    %
    No matter how good you are, there is always someone better!!!

  5. #5
    Join Date
    May 2007
    Posts
    1003
    Quote Originally Posted by chrisryn View Post
    Im not sure why I made the equal to different variables. I notice the typo. the #29 variable doesn't exist I am checking the results of #129=#127/2
    Oops. #29 was a typo on my part. Should have read #129. Sorry.

Similar Threads

  1. Fanuc 18i custom macro B
    By djmcdaris in forum Fanuc
    Replies: 18
    Last Post: 03-09-2021, 02:07 PM
  2. custom macro question
    By sinha_nsit in forum G-Code Programing
    Replies: 28
    Last Post: 04-18-2009, 12:44 PM
  3. Custom Macro B On A 18t.
    By JIMMYZ in forum Fanuc
    Replies: 3
    Last Post: 10-19-2006, 04:08 AM
  4. custom macro
    By The Metal in forum Daewoo/Doosan
    Replies: 2
    Last Post: 09-28-2006, 01:26 PM

Posting Permissions

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