603,790 active members*
8,361 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2007
    Posts
    10

    Fanuc custom Macro Question????

    The following is my Custom Macro program of my Takeda Drilling Center Fanuc 10m:

    O9000(ATC CUSTOM MACRO)
    #3003=1
    IF[#1012EQ1]GOTO8
    IF[#1013EQ1]GOTO8
    IF[#1014EQ1]GOTO8
    #101=#4003
    #102=#4002
    IF[#500NE0]GOTO1
    WHILE[#1015EQ1]DO1
    #3000=1(TOOL CLAMP ALARM)
    END1
    IF[#149NE0]GOTO1
    #3000=2(T CODE ERROR/T0...T0)
    N1IF[#500NE#149]GOTO2
    #3003=0

    M99
    N2G80G49G40
    IF[#149LE36]GOTO3
    #3000=3(T CODE OVER DATA)
    N3
    IF[#1015NE0]GOTO4
    T1
    M90
    M19
    T2
    N4G91G28Z0
    T1
    M19
    IF[#500EQ0]GOTO5
    G53G90G00X#[#500+500]Y0
    G23
    G53Z-95.45Y80.0
    G53Y150.2
    M91
    #500=#149
    #1=BCD[#149]
    #1132=#1132OR63
    #1132=#1132AND#1
    #1115=1
    G91G28Z0M92
    IF[#149GT0]GOTO6
    G28Y0M93
    T2
    G22
    G#101
    G#102
    G61
    #3003=0
    #1115=0

    M99
    N5G91G28Y0
    N6G23
    G53G90G00X#[#149+500]Y150.2
    T1
    M91
    N7G53Y150.2
    G53Z-80.0M92
    G53Z-95.45
    M93
    M90
    G53Y80.0
    T2
    #500=#149
    #1=BCD[#149]
    #1132=#1132OR63
    #1132=#1132AND#1
    #1115=1
    G91G28Z0Y0
    G22
    G#101
    G#102
    G61
    N8#3003=0
    #1115=0

    M99

    The tooling are placed along the x-axis. If I want to change the tool. The x-axis will move to the tool and clamp it into the spindle head.

    If I want to change the tool, I command "Txx"(xx = tool number such as T01 is tool no. 1). And the program will excecute automatically.

    My problem is I try to increase my memory by installing new ram into the motherboard. But I need to clear out all the memories including "Custom Macro Variable".

    In the program, I can run it all, Clamp and Unclamp tooling and etc, the functions except,
    "moving x-axis"
    IF[#500EQ0]GOTO5
    G53G90G00X#[#500+500]Y0
    The program don't know the value of #500 Variable.
    N6G23
    G53G90G00X#[#149+500]Y150.2
    The program don't know where to collect the value of #149 Variable. I think this is the tool number.

    I don't know this Macro Program is Macro B or not.
    What can I do to excecute the x-axis moving to the right position to get the tooling.

    Thanks guy for your help.

  2. #2
    Join Date
    Sep 2010
    Posts
    1230
    Set bit number 5 of parameter 0319 to 1. This will allow single step of every macro statement and therefore enable you to check the value of the Macro variables and the flow of the program in single block.

    Variable #500 is a Common variable that retains it's value when power off. Check the value of #500 before you try a tool change. I haven't checked the logic of the program thoroughly, but #500 may have had a value preset by the OEM, and if you cleared the memory and didn't record the value, then this may be part of your problem. #500 needs to have a value other than Zero to get past the first error trap.

  3. #3
    Join Date
    Apr 2007
    Posts
    10
    Thank alot for your help man.
    I can solve the problem.

  4. #4
    Join Date
    Feb 2006
    Posts
    1792
    Null variables:
    Except for EQ and NE, a null variable is treated as 0 in arithmetic and conditional expressions.

  5. #5
    Join Date
    Jan 2009
    Posts
    39

    #1=BCD[#149]

    Gentlemen,
    In ixoxi999s macro it has this statement:
    #1=BCD[#149]
    My question is what is BCD? Thank You :cheers:

  6. #6
    Join Date
    Feb 2006
    Posts
    1792
    BCD[_] changes its argument to BCD representation, interprets it in binary and outputs that value.
    Let us say #149 contains 10 (in BCD[#149]).
    BCD representation of 10 is 0001 0000.
    The binary interpretation of 00010000 is 16.
    So, 16 is output. Thus, BCD[10] = 16.

    BCD and BIN functions are used in association with system variables for input/output interface signals.

    For more information, read the attachment.

    Sinha
    Attached Files Attached Files

  7. #7
    Join Date
    Jun 2008
    Posts
    1511
    Quote Originally Posted by ixoxi999 View Post
    Thank alot for your help man.
    I can solve the problem.
    So what was the solution to the problem?? It may help others with similar problems.

    With a quick glance at your code it appears that #500 is to be set to the current tool that is in the spindle. With this being cleared it got mugged up on you. Was that the solution?

    Stevo

  8. #8
    Join Date
    Dec 2011
    Posts
    0

    Please observe the following macro

    #500: the current tool in the spindle (1, 2, 3,...36)
    #501: The position of the tool 1 (A)
    #502: The position of the tool 2 (A+B); B:distance between two tool
    #503: The position of the tool 3 (A+2B)
    #504: The position of the tool 4 (A+3B)
    ...
    ...
    #536:The position of the tool 36 (A+35B)
    triphat-tp co., ltd; [email protected]

    O9000(ATC CUSTOM MACRO)
    #3003=1
    IF[#1012EQ1]GOTO8
    IF[#1013EQ1]GOTO8
    IF[#1014EQ1]GOTO8
    #101=#4003
    #102=#4002
    IF[#500NE0]GOTO1
    WHILE[#1015EQ1]DO1
    #3000=1(TOOL CLAMP ALARM)
    END1
    IF[#149NE0]GOTO1
    #3000=2(T CODE ERROR/T0...T0)
    N1IF[#500NE#149]GOTO2
    #3003=0

    M99
    N2G80G49G40
    IF[#149LE36]GOTO3
    #3000=3(T CODE OVER DATA)
    N3
    IF[#1015NE0]GOTO4
    T1
    M90
    M19
    T2
    N4G91G28Z0
    T1
    M19
    IF[#500EQ0]GOTO5
    G53G90G00X#[#500+500]Y0
    G23
    G53Z-95.45Y80.0
    G53Y150.2
    M91
    #500=#149
    #1=BCD[#149]
    #1132=#1132OR63
    #1132=#1132AND#1
    #1115=1
    G91G28Z0M92
    IF[#149GT0]GOTO6
    G28Y0M93
    T2
    G22
    G#101
    G#102
    G61
    #3003=0
    #1115=0

    M99
    N5G91G28Y0
    N6G23
    G53G90G00X#[#149+500]Y150.2
    T1
    M91
    N7G53Y150.2
    G53Z-80.0M92
    G53Z-95.45
    M93
    M90
    G53Y80.0
    T2
    #500=#149
    #1=BCD[#149]
    #1132=#1132OR63
    #1132=#1132AND#1
    #1115=1
    G91G28Z0Y0
    G22
    G#101
    G#102
    G61
    N8#3003=0
    #1115=0

    M99

    The tooling are placed along the x-axis. If I want to change the tool. The x-axis will move to the tool and clamp it into the spindle head.

    If I want to change the tool, I command "Txx"(xx = tool number such as T01 is tool no. 1). And the program will excecute automatically.

    My problem is I try to increase my memory by installing new ram into the motherboard. But I need to clear out all the memories including "Custom Macro Variable".

    In the program, I can run it all, Clamp and Unclamp tooling and etc, the functions except,
    "moving x-axis"
    IF[#500EQ0]GOTO5
    G53G90G00X#[#500+500]Y0
    The program don't know the value of #500 Variable.
    N6G23
    G53G90G00X#[#149+500]Y150.2
    The program don't know where to collect the value of #149 Variable. I think this is the tool number.

    I don't know this Macro Program is Macro B or not.
    What can I do to excecute the x-axis moving to the right position to get the tooling.

    Thanks guy for your help.[/QUOTE]

  9. #9
    Join Date
    Jun 2008
    Posts
    1511
    Your program states that #500 is suppose to be the current tool in the spindle so set #500 via MDI equal to the current tool in the spindle.

    #149 is probably being set via T() command thru a parameter setting which also calls program 9000. Make sure you have that parameter set. It is different depending on which model Fanuc control you are using. Since you did not tell us which control you are using we cannot tell you which parameter to set. You can also test this by programming a T() command and then checking parameter #149 and it should be set to your modal T().

    FYI it is macroB that it is coded to.

    It will also help in the future to start a new thread related to your problem instead of posting in one that is over a year old and not related at all to your issue.

    Stevo

  10. #10
    Join Date
    Aug 2011
    Posts
    2517

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 B
    By rlgx4 in forum Parametric Programing
    Replies: 7
    Last Post: 08-02-2010, 10:05 PM
  3. "difference between Custom Macro A and Custom Macro B"
    By arulthambi in forum Parametric Programing
    Replies: 4
    Last Post: 10-05-2009, 09:34 PM
  4. custom macro question
    By sinha_nsit in forum G-Code Programing
    Replies: 28
    Last Post: 04-18-2009, 12:44 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
  •