Need Help! Mill program GOTO condition


Results 1 to 10 of 10

Thread: Mill program GOTO condition

  1. #1
    Registered
    Join Date
    Oct 2016
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Mill program GOTO condition

    Hi,

    I'm working on a milling with Fanuc controller.
    I'm trying to adjust the tool change command with the GOTO condition but I don't know how it work.
    Here's what my program look like :


    (* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *)
    (LOAD TOOL NO: 10 DRILL .500)
    (* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *)
    N10 M5
    N12 M1
    N14 G54
    IF[#994EQ10]GOTO?
    N16 T10
    N18 M6
    N20 M1
    N22 G40
    N24 S391 M3

    The thing here is : IF the tool number (10) actually in the spindle (#994 = 10 variable) is EQual to 10, GOTO (I would like to next M1 at line N20)

    The reason why is like that is, Fanuc give me an alarm if the tool is called (T10, M6) while he his already in the spindle so that's why I want a GOTO to next M1 if the tool is already in spindle to skip tool change.

    So my question is : how can I complete the GOTO condition that it will automatically calculate to jump 3 lines lower or going to next M1 (like GOTO N+3..... GOTO next M1) cause right now I'm adding the line number manually each time my program is posted.

    Tx a lot for help

    Phil

    Similar Threads:


  2. #2
    Member
    Join Date
    Jan 2009
    Location
    United States
    Posts
    103
    Downloads
    1
    Uploads
    0

    Default Re: Mill program GOTO condition

    you can do this in several ways. the best way is to write a tool change macro so when M6 is read it will run a macro program
    that checks to see if the tool is in the spindle. variable #4120 will have the last the value of T read in the program:

    (* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *)
    (LOAD TOOL NO: 10 DRILL .500)
    (* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *)
    N10 M5
    N12 M1
    N14 G54
    N16 T10(this line will load 10 in #4120)
    N18 M6(assign 6 to parameter 6080 which will call program O9020 when M6 is read)
    N20 M1
    N22 G40
    N24 S391 M3

    O9020(TOOL CHANGE MACRO)
    IF[#994 NE #4120]THEN M6
    M99

    or

    O9020(TOOL CHANGE MACRO)
    IF[#994 EQ #4120]GOTO1
    M6
    N1
    M99

    doing it this way you won't have to edit your program. if parameter 6080 has a value in it already, you can use 6081-6089 which
    will call O9021-O9029 respectively

    Last edited by mcode; 06-06-2017 at 09:08 AM.


  3. #3
    Registered
    Join Date
    Oct 2016
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Re: Mill program GOTO condition

    Tx a lot for the info
    I'll give a try for sure



  4. #4
    Member
    Join Date
    Feb 2006
    Location
    india
    Posts
    1792
    Downloads
    0
    Uploads
    0

    Default Re: Mill program GOTO condition

    "IF[#994 NE #4120]THEN M6" would alarm out, because M6 is an NC statement; only single macro statement is allowed.



  5. #5
    Member
    Join Date
    Jan 2009
    Location
    United States
    Posts
    103
    Downloads
    1
    Uploads
    0

    Default Re: Mill program GOTO condition

    Thanks for the correction, I haven't tried it in a Fanuc control until testing it out this morning.
    The statement doesn't alarm out in a Haas control. My second example will work fine for the OP



  6. #6
    Registered
    Join Date
    Oct 2016
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Re: Mill program GOTO condition

    Here's the macros that is built-in when i do a mdi tool change (T1;M6 :

    9000 (T-CALL MACRO)
    (#6001.5=1)
    T#149
    M99

    9026 (M6 CALL SERVO-ATC)
    (PRM6086=6)
    #3003=1
    G90 G53 Z0
    G90 G53 A0 Y0
    M6
    #990=#149
    M98 P9050
    G91
    G28 Z0
    G90 G53 X-20.
    G53 Y-20.
    M5
    #3003=0
    M99

    Maybe it could help



  7. #7
    Member
    Join Date
    Jan 2009
    Location
    United States
    Posts
    103
    Downloads
    1
    Uploads
    0

    Default Re: Mill program GOTO condition

    you could modify your tool change macro like this:

    9026 (M6 CALL SERVO-ATC)
    (PRM6086=6)
    #3003=1
    G90 G53 Z0
    G90 G53 A0 Y0
    IF[#994 EQ #149]GOTO1
    M6
    N1
    #990=#149
    M98 P9050
    G91
    G28 Z0
    G90 G53 X-20.
    G53 Y-20.
    M5
    #3003=0
    M99


    Not sure what O9050 program does. I'm also assuming that #994 holds the current spindle tool as per your program example. your tool change macro saves the tool called in #990.



  8. #8
    Registered
    Join Date
    Oct 2016
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Re: Mill program GOTO condition

    A huge thanks for the help guys

    Yes, #994 holds the current spindle tool and the macro saves the tool called in #990.

    The fact is i can't really change or play with thoses tool change Macro in here in the company

    We bought BobCAD CAM for simple 3-4 axis part recently and i was trying to adjust the Fanuc post tool change code to work like it work here in our programming department who's pgrogramming with Catia V5. Catia post generated the code line i want BobCAD to do.
    .
    If i take a Catia program, at each tool change, their post automatically generate the GOTO (line number) to jump to next M1 three lines lower to skip the automatic tool probing line.
    The only place in the BobCAD post that i'm stuck with is that GOTO line generated
    Maybe is more simple if i show you guys the BobCAD post

    n, spindle_off
    n,"M1"
    n,work_coord,
    "(TOOL #", list_tool_number, " " , tool_label, ")"
    n,"M5"
    n,"M1"
    n,work_coord,
    "IF[#"994""force_no_add_spaces"EQ"force_no_add_spaces, list_tool_number"]GOTO"
    n,t
    n,"M6"
    n,"G65P9904Z8.A0W.003U0V0" (Tool probing)
    n,"M1"
    n,"G40"
    n, work_coord
    n, s, spindle_on

    Tx again for the help



  9. #9
    Member
    Join Date
    Jan 2009
    Location
    United States
    Posts
    103
    Downloads
    1
    Uploads
    0

    Default Re: Mill program GOTO condition

    The programming dept. should want to modify the tool change macro because it will eliminate the workaround in the post and also work when you call up a tool in MDI. If they won't you try this in your post:

    n, spindle_off
    n,"M1"
    n,work_coord,
    "(TOOL #", list_tool_number, " " , tool_label, ")"
    n,"M5"
    n,"M1"
    n,work_coord,
    "IF[#"994""force_no_add_spaces"EQ"force_no_add_spaces, list_tool_number"]GOTO1"
    n,t
    n,"M6"
    n,"G65P9904Z8.A0W.003U0V0" (Tool probing)
    "N1M1"
    n,"G40"
    n, work_coord
    n, s, spindle_on

    your control should be able to run without sequence numbers and also be able to have duplicate ones also. the GOTO command will search forward in the program to the first N1 so it will work for all the tool changes.
    if the tool change macro was changed it wouldn't affect the the way they're programming right now. They should at least try the change out to verify that it will work. just saying



  10. #10
    Registered
    Join Date
    Oct 2016
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Re: Mill program GOTO condition

    I'm agree with you that the programming dept. should modify the tool change macro.
    I will try to let them know and if it's possible to modify that macro :/

    If they can't or they don't want....
    You're GOTO1 with the N1 line is exactly what i had in mind for my Plan-B but i was not sure if the line search was always forward

    I'll go with that option first and will try to work the post dept for their Fanuc tool change macro

    Tx a lot for the help.....really appreciated



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

Mill program GOTO condition

Mill program GOTO condition