591,380 active members*
7,138 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > Current Tool Variable # Fanuc 31i Model B
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2021
    Posts
    6

    Current Tool Variable # Fanuc 31i Model B

    Hi,
    I’m trying to find the variable that holds the number for the current tool that’s called up for a Macro. It’s on a Doosan Puma with 31i control.
    I have seen similar posts on here suggesting #4120 but that just contains 0.

  2. #2
    Join Date
    Aug 2007
    Posts
    833
    Quote Originally Posted by jedd View Post
    Hi,
    I’m trying to find the variable that holds the number for the current tool that’s called up for a Macro. It’s on a Doosan Puma with 31i control.
    I have seen similar posts on here suggesting #4120 but that just contains 0.
    Upload your macro or entire backup here

  3. #3
    Join Date
    Dec 2012
    Posts
    398

    Re: Current Tool Variable # Fanuc 31i Model B

    Hi,

    Check your Tool Change Macro.
    Probably stored in #100, in my macro it is; #100 = #4120, Toolnumber is shown in #100.

    Regards.

  4. #4
    Join Date
    Aug 2007
    Posts
    833
    Quote Originally Posted by Heavy_Metal View Post
    Hi,

    Check your Tool Change Macro.
    Probably stored in #100, in my macro it is; #100 = #4120, Toolnumber is shown in #100.

    Regards.
    If #4120=0 then
    #100=#4120=0

    #100 - local temporary variable
    #4120 - global system variable

  5. #5
    Join Date
    Dec 2012
    Posts
    398

    Re: Current Tool Variable # Fanuc 31i Model B

    Mr guhl,

    Were did I say #4120 = 0 and #100 = 0 ???
    When I do a toolchange like T9 M6 varaible #100 shows 9 after toolchange, depending on the toolnumber !!!!
    My ( HWacheon Vesta 1000 ) macro says: #100 = #4120 and stores the 9 in #100, simple as that.

    O9020(M06 T..AUTO CHANGE)
    G31
    #148=#4003
    IF[#1014EQ1]GOTO10
    IF[#20EQ#0]GOTO10
    IF[#20EQ0]GOTO902
    #100=#20
    GOTO20
    N10#100=#4120
    N20
    M606T#100
    G49
    G#148
    M99
    N902#3000=2(M06 TF-CODE COMMAND ERROR)
    M30

  6. #6
    Join Date
    Aug 2007
    Posts
    833
    Quote Originally Posted by Heavy_Metal View Post
    Mr guhl,

    Were did I say #4120 = 0 and #100 = 0 ???
    When I do a toolchange like T9 M6 varaible #100 shows 9 after toolchange, depending on the toolnumber !!!!
    My ( HWacheon Vesta 1000 ) macro says: #100 = #4120 and stores the 9 in #100, simple as that.

    O9020(M06 T..AUTO CHANGE)
    G31
    #148=#4003
    IF[#1014EQ1]GOTO10
    IF[#20EQ#0]GOTO10
    IF[#20EQ0]GOTO902
    #100=#20
    GOTO20
    N10#100=#4120
    N20
    M606T#100
    G49
    G#148
    M99
    N902#3000=2(M06 TF-CODE COMMAND ERROR)
    M30
    You wrote
    #100=#4120
    Hence, if #4120=0 (like author claimed), then we can say that #100 will be equal 0 as well
    #4120=0 and #100=4120 -> #100=0
    Author will see in #100 the same like in #4120

  7. #7
    Join Date
    Feb 2013
    Posts
    22

    Re: Current Tool Variable # Fanuc 31i Model B

    jedd,

    #4120 is a system variable that you can not see. If, like Heavy_Metal said, you go into your tool change program and right after the M6 add #100=#4120.
    Then when you look in your macro variables page you will see your tool number in 100.
    Just a note, you can use any common variable you choose (#100 to #199) it does not have to be just #100

  8. #8
    Join Date
    Jul 2021
    Posts
    6

    Re: Current Tool Variable # Fanuc 31i Model B

    Thanks for the replies. I was looking through SYSTEM>PARAMETERS thinking it was reading from there.
    Is there no way of browsing through the system variables or can I find a list anywhere of other system variables?
    Thanks

  9. #9
    Join Date
    Dec 2012
    Posts
    398

    Re: Current Tool Variable # Fanuc 31i Model B

    Hi,

    There are plenty of variable lists, just Google for it.

    https://www.cnccookbook.com/fanuc-ma...d-programming/
    https://www.machinetoolhelp.com/Appl...variables.html

    and many more.

  10. #10
    Join Date
    Aug 2024
    Posts
    1

    Re: Current Tool Variable # Fanuc 31i Model B

    Quote Originally Posted by jedd View Post
    Hi,
    I’m trying to find the variable that holds the number for the current tool that’s called up for a Macro. It’s on a Doosan Puma with 31i control.
    I have seen similar posts on here suggesting #4120 but that just contains 0.
    On a Doosan Puma with a 31i control, the variable that holds the current tool number for a macro is typically #5000
    papa's scooperia

Similar Threads

  1. System variable for the current tool length
    By kheston in forum Tormach PathPilot™
    Replies: 4
    Last Post: 03-07-2018, 04:37 PM
  2. Variable out of range Fanuc 31i
    By markkirby in forum G-Code Programing
    Replies: 20
    Last Post: 10-15-2010, 02:50 PM
  3. fanuc 31i - model A5
    By anilam in forum Fanuc
    Replies: 16
    Last Post: 02-15-2010, 02:22 PM
  4. Current tool # variable
    By hydrospin01 in forum Fanuc
    Replies: 6
    Last Post: 07-15-2008, 07:32 PM
  5. Macro variable for current tool diam ?
    By Shizzlemah in forum Fadal
    Replies: 3
    Last Post: 10-30-2006, 03:47 PM

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
  •