Page 1 of 3 123 LastLast
Results 1 to 12 of 27

Thread: Toolchange macro to make multiple parts

  1. #1
    Registered vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    24
    Downloads
    0
    Uploads
    0

    Toolchange macro to make multiple parts

    There is someone interested by a toolchange macro i created that loop each tool for mutiple parts. IE you set one variable at the program start for the part quantity for example #800=4 and the machine take the tool 1 and make all the operations on G54,G55,G56,G57 and also if you want G54 P1, G54 P2, etc. and then take the tool 2 and do all operations in reverse G57,G56,G55,G54...really usefull when you want to choose part QTY right on the floor.It also support the G5 P10000 (ai Nano HPCC) function that doesn't support macro calculation when activated. If interested reply and i will post all is needed to do it!


  2. #2
    Registered fordav11's Avatar
    Join Date
    Aug 2011
    Location
    Fordaville
    Posts
    1,668
    Downloads
    0
    Uploads
    0
    there is always interest in macros that do useful things. please post it here if you want to.


  3. #3
    Registered
    Join Date
    Nov 2006
    Location
    USA Texas
    Posts
    354
    Downloads
    0
    Uploads
    0
    I'd like to check it out as well!


  4. #4
    Registered vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    24
    Downloads
    0
    Uploads
    0

    toolchange macro

    I finally posted it

    there's the macro

    O9000(TOOLCHANGE*MACRO)
    IF[#4113EQ98]THEN#10=1
    IF[#4EQ1]GOTO13(GO*BACK*TO*CURRENT*TC)
    IF[#5NE#0]GOTO6(WPC*UP)
    IF[#6NE#0]GOTO9(WPC*DOWN)
    IF[#10EQ1]GOTO14(SEND*TO*END*OF*PROGRAM)
    #3=#4114(SEQUENCE*N*FLAG)
    #11=#149/100
    #11=FIX[#11](CALC*TOOL)
    #12=[#149-[#11*100]](CALC*PRELOAD)
    IF[#11EQ0]THEN#11=#12(MANUAL*TC)
    IF[#11EQ#12]THEN#12=#0
    IF[#11EQ30]THEN#11=0(PROBE=T30*FOR*PRELOAD)
    IF[#11EQ#702]GOTO5(SAME*TOOL*SKIP)
    IF[#703EQ0]GOTO2(SKIP*ROTARY*PROTECT*IF*DISABLED)
    IF[#1EQ#0]GOTO1(MANUAL*TC*PROTECTION*WITH*ROTARY)
    IF[#7741EQ0]GOTO15(ALARM*IF*FACEPLATE*PROBING*NOT*DONE)
    IF[#5021+[#1-#5041]GT#7741]GOTO2(SKIP*IF*TC*IS*SAFE)
    IF[#5021+[#1-#5041]LE#7741]THEN#1=#5041-[#5021-#7741](ROTARY*TC*PROTECTION)
    G5P0
    M9
    G91G28Z0M19
    G90X#1
    GOTO2
    N1
    IF[#5021LE#7741]THEN#1=#5041-[#5021-#7741]
    G5P0
    M9
    G91G28Z0M19
    G90X#1
    N2
    IF[#3GE2]GOTO3
    IF[#4014NE54.1]THEN#801=#4014(SET*FIRST*WPC*G54-G59)
    IF[#4014EQ54.1]THEN#801=#4130(SET*FIRST*WPC*G54*P1-P48)
    N3
    IF[#5021+[#1-#5041]LE0]THEN#1=#0(X-*OT*CHECK)
    IF[#5021+[#1-#5041]GE60.7]THEN#1=#0(X+*OT*CHECK)
    IF[#5022+[#2-#5042]LE-30.]THEN#2=#0(Y-*OT*CHECK)
    IF[#5022+[#2-#5042]GE0]THEN#2=#0(Y+*OT*CHECK)
    #700=#4001(MOVE*TYPE*FLAG)
    #701=#4003(ABS*INC*FLAG)
    M46
    IF[#4120NE0]THENGOTO4(PROBE*SPINDLE*LOCK)
    S0M47
    N4
    G5P0
    M9
    G91G28Z0T#11M19
    G90X#1Y#2M6
    #702=#4120
    T#12
    #1=#0
    #2=#0
    N5
    G#700
    G#701N#3
    #1=#0
    #2=#0
    M1(OPTIONAL*STOP)
    (SET*WPC*MULTIPART*SECTION)
    IF[#800LE1]GOTO12(SKIP*SECTION*IF*ONE*PART)
    #7=#3/2(CHECK*IF*TC*NWORD*IS*ODD*OR*EVEN)
    #8=FIX[#7]
    #9=FUP[#7]
    IF[#8EQ#9]GOTO9(SEND*TO*WPC*DOWN*IF*ODD)
    N6(WPC*UP)
    #4=1
    IF[#5NE#0]THEN#5=#5+1
    IF[#5EQ#0]THEN#5=#801
    IF[#5LE48]GOTO7
    G#5
    GOTO8
    N7
    G54P#5
    N8
    IF[#5EQ[[#800-1]+#801]]THEN#5=#0
    IF[#5EQ#0]THEN#4=#0
    GOTO12
    N9(WPC*DOWN)
    #4=1
    IF[#6NE#0]THEN#6=#6-1
    IF[#6EQ#0]THEN#6=[[#800+#801]-1]
    IF[#6LE48]GOTO10
    G#6
    GOTO11
    N10
    G54P#6
    N11
    IF[#6EQ#801]THEN#6=#0
    IF[#6EQ#0]THEN#4=#0
    N12(RETURN*TO*PROGRAM)
    M99
    N13(GO*CURRENT*TC)
    IF[#800LE1]GOTO14
    M56
    #4=#0
    M99P#3
    N14(SEND*TO*END*OF*PROGRAM)
    #3=#3+1
    #10=#0
    #800=#0
    #801=#0
    M99P#3
    N15
    #3000=1(PROBE*ROTARY*FACEPLATE)
    M99
    (#1=TC*X*RAPID)
    (#2=TC*Y*RAPID)
    (#3=CURRENT*TOOL*NWORD)
    (#4=RETURN*TO*CURRENT*TC*FLAG)
    (#5=CURRENT*UP*WPC)
    (#6=CURRENT*DOWN*WPC)
    (#7=CURRENT*TOOL*SPLIT*TO*ROUND)
    (#8=ROUND*DOWN)
    (#9=ROUND*UP)
    (#10=END*OF*PROGRAM*FLAG)
    (#11=TWORD)
    (#12=CURRENT*PRELOAD)
    (#700=MOVE*TYPE*FLAG)
    (#701=ABS/INC*FLAG)
    (#702=CURRENT*TOOL)
    (#800=PART*QTY)
    (#801=FIRST*WPC)




    there's a sample program
    %
    O6001 (18-19)
    #800=1 (PART QUANTITY)
    G17 G20 G40 G54 G90 G98
    #1=-2.875
    #2=-1.25
    N1 T0610 (ENDMILL 3/8" CARBIDE 2FL.)
    M3 S10000
    G5 P10000
    G0 X-2.875 Y-1.25 M8
    G43 H6 Z-.175
    G1 Y.25 F75.
    G0 Z.5
    X2.875
    Z-.175
    G1 Y-1.25
    G0 Z.5
    X2.2813 Y-.5
    Z.1
    G1 Z-.275 F40.
    X2.2822
    G3 I-.001
    G1 X2.2813
    G0 Z.5
    X-2.2813
    Z.1
    G1 Z-.275
    X-2.2803
    G3 I-.001
    G1 X-2.2813
    G0 Z.5
    G5 P0
    #1=0
    #2=-.625
    N2 T1000 (DRILL 5/32")
    M3 S4890
    G0 X0 Y-.625 M8
    G43 H10 Z.5
    G81 X0 Y-.625 R.1 Z-.2719 F29.3
    G80
    M98 P9000
    N3 M9
    G53 X30. Y0 Z0 M19
    M30
    %


  • #5
    Registered samu's Avatar
    Join Date
    Feb 2007
    Location
    quebec
    Posts
    264
    Downloads
    0
    Uploads
    0
    I was thinking about something like that and i recently wrote my own. It works great for short program but with a 200 block program,that is not very long, the last tool takes almost 5 sec to loop. I have also written a macro that loop a defined number of program on a defined number of work offset. Search for a program is much more faster than search for a block number. But you have to separate each tool on a single prog.

    If any interest to see that, let me know


  • #6
    Registered
    Join Date
    Jul 2011
    Location
    usa
    Posts
    19
    Downloads
    0
    Uploads
    0
    I need to put the tool in the same packet from which was take it, for example if I take the T01 from packet # 1 finished work how can I write the program so that the tool T01 back to packet # 1


  • #7
    Registered samu's Avatar
    Join Date
    Feb 2007
    Location
    quebec
    Posts
    264
    Downloads
    0
    Uploads
    0
    I assume that you have a random tool changer. Why do you want to return the tool in a specific pocket? You can write a macro to track which tool is in a pocket and a reorder macro to return each tool in its initial pocket at the end of the program. But in involve a lot of useless tool change. Maybe if you explain what you really want to do and why you want to do this, with some details on your tool changer, we could find an efficient solution.


  • #8
    Registered
    Join Date
    Jul 2011
    Location
    usa
    Posts
    19
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by samu View Post
    I assume that you have a random tool changer. Why do you want to return the tool in a specific pocket? You can write a macro to track which tool is in a pocket and a reorder macro to return each tool in its initial pocket at the end of the program. But in involve a lot of useless tool change. Maybe if you explain what you really want to do and why you want to do this, with some details on your tool changer, we could find an efficient solution.
    I need put back the tools to the same packet because the diameter of the tool is big.
    When the program is running the tools are put in any packet back so when tools of large diameter come together it's lockup each other and how to prevent this from happening is keeping them always in the same packete


  • #9
    Registered
    Join Date
    Apr 2012
    Location
    USA
    Posts
    24
    Downloads
    0
    Uploads
    0

    Re: Toolchange macro to make multiple parts

    You should be able to flag the tool as large or big or heavy in the offset page.

    Read your manual to be sure

    Sent from my SAMSUNG-SGH-I747 using Tapatalk 2


  • #10
    Registered samu's Avatar
    Join Date
    Feb 2007
    Location
    quebec
    Posts
    264
    Downloads
    0
    Uploads
    0
    You should be able to flag the tool as large or big or heavy in the offset page.

    Read your manual to be sure
    If you can do that go this way.

    Another way is to call always the same tool before the ''real tool change''.
    let a pocket empty, suppose it is T20=empty

    O1234
    G17 G40 ...
    T20 M6 (spindle is empty)
    T1 M6 (first tool in spindle pocket 1 empty)
    X... Y... M3 s....
    T20 M6 (spindle empty first tool back in pocket 1)
    T2 M6 (second tool in spindle pocket 2 empty)
    X... Y...
    T20 M6 (spindle empty second tool back in pocket 2)
    T3 M6 (third tool in spindle, pocket 3 empty)
    etc. etc. ....

    Even if T20 is not empty, it works.


  • #11
    Registered
    Join Date
    Aug 2011
    Location
    United States
    Posts
    68
    Downloads
    0
    Uploads
    0
    Has anyone tried this macro? Results? Sounds like it could be pretty useful!


  • #12
    Registered samu's Avatar
    Join Date
    Feb 2007
    Location
    quebec
    Posts
    264
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by blkaplan View Post
    Has anyone tried this macro? Results? Sounds like it could be pretty useful!
    Like i said, I tried something similar but with a 10 tool 1000 block program, it is not very fast because when you jump out of the macro, the control have to search from the beginning of the main program for the block you want to loop. The farther the block is, the longer is search time. Maybe with a recent control it doesn't affect so much but with my 0M-D, just for about 180 blocks, it takes about five second!!! The solution is to separate each tool in a sub and search for the program number of this tool which is much more faster than search for a block number. Here is the macro (tested, i use it on a regular basis)

    ******************************************************
    * ALLOW TO LOOP MANY PROG ON MANY WORK OFFSET *
    * FORMAT: G65 A... B... C... D...F... P9201 *
    * A=FIRST WORK OFFSET(G54, G55, G56 ECT) *
    * B=QUANTITY OF WORK OFFSET *
    * C=FIRST PROG NUMBER TO LOOP *
    * D=LAST PROG NUMBER TO LOOP *
    * F=SET TO 1 TO BEGGIN BY THE LAST WORK OFFSET *
    ******************************************************
    %
    O9201
    #11=#7-#3 (QUANTITY OF PROGRAM TO LOOP)
    #12=#3 (WORKING COPY OF THE FIRST PROG)
    #13=0 (PROGRAM COUNTER)
    N10DO1
    #10=0 (LOOP COUNTER)
    IF[#9NE1]GOTO11 (IF YOU DON'T WANT TO BEGIN BY THE LAST WORK OFFSET JUMP TO)
    #1=#1+#2-1 (SET LAST WORK OFFSET)
    GOTO16
    N11DO2
    G#1 (SET CURRENT WORK OFFSET)
    M98P#12 (CALL CURRENT PROGRAM)
    #10=#10+1 (INCREMENT LOOP COUNTER)
    IF[#10EQ#2]GOTO15 (IF CURRENT PROG HAS BEEN RUN ON ALL WORK OFFSET JUMP TO)
    #1=#1+1 (INCREMENT WORK OFFSET)
    END2
    N15#13=#13+1 (INCREMENT PROG COUNTER)
    IF[#13GT#11]GOTO18 (IF ALL PROG HAVE BEEN RUN JUMP TO)
    #10=0 (RESET LOOP COUNTER)
    #12=#12+1 (INCREMENT PROG NUMBER)
    N16DO2
    #9=0 (CLEAR THE BEGIN BY THE LAST OFFSET FLAG)
    G#1 (SET CURRENT WORK OFFSET)
    M98P#12 (CALL CURRENT PROG)
    #10=#10+1 (INCREMENT LOOP COUNTER)
    IF[#10EQ#2]GOTO17 (IF CURRENT PROG HAS BEEN RUN ON ALL WORK OFFSET JUMP TO)
    #1=#1-1 (DECREMENT WORK OFFSET)
    END2
    N17#13=#13+1 (INCREMENT PROG COUNTER)
    IF[#13GT#11]GOTO18 (IF ALL PROG HAVE BEEN RUN JUMP TO)
    #12=#12+1 (INCREMENT PROG NUMBER)
    END1
    N18M99
    %


  • Page 1 of 3 123 LastLast

    Similar Threads

    1. How do I make multiple passes on arc.
      By Andrew96 in forum Vectric
      Replies: 4
      Last Post: 07-02-2011, 12:16 AM
    2. Toolchange macro/sub for OSP5000L
      By nlh in forum Okuma
      Replies: 7
      Last Post: 10-02-2010, 06:31 AM
    3. Need Help!- how to get multiple parts from a bar
      By firekoe in forum Fanuc
      Replies: 13
      Last Post: 02-11-2010, 09:23 AM
    4. KIWA excel 510 toolchange macro help
      By bensoli in forum General Metal Working Machines
      Replies: 0
      Last Post: 12-29-2009, 12:49 PM
    5. Macro b multiple choice menu?
      By tomi6678 in forum Parametric Programing
      Replies: 2
      Last Post: 12-12-2009, 03:16 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.