Custom macro!!!!


Results 1 to 5 of 5

Thread: Custom macro!!!!

  1. #1
    Registered
    Join Date
    Mar 2006
    Location
    United States
    Posts
    153
    Downloads
    0
    Uploads
    0

    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.

    Similar Threads:
    No matter how good you are, there is always someone better!!!


  2. #2
    Member
    Join Date
    May 2007
    Location
    USA
    Posts
    1003
    Downloads
    0
    Uploads
    0

    Default

    "{" 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
    Registered
    Join Date
    Mar 2006
    Location
    United States
    Posts
    153
    Downloads
    0
    Uploads
    0

    Default

    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
    Registered
    Join Date
    Mar 2006
    Location
    United States
    Posts
    153
    Downloads
    0
    Uploads
    0

    Default

    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
    Member
    Join Date
    May 2007
    Location
    USA
    Posts
    1003
    Downloads
    0
    Uploads
    0

    Default

    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.



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
  •  


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

Custom macro!!!!

Custom macro!!!!