585,898 active members*
5,077 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 21
  1. #1
    Join Date
    Sep 2010
    Posts
    0

    Unhappy Custom Macro Containing G65

    I am hoping someone with a lot more Macro experience will be able to help me. I have inherited a Custom Macro program (and the original machines that the program was written for and works on) from a sister company. The original machines are a Fanuc 16i (I think) and I am trying to get it to work on an 18i-T. The program is designed to generate slots with the X and C axis. I have alot of questions. I am hoping that someone is familiar with this and can help!!!

  2. #2
    Join Date
    Mar 2003
    Posts
    2932
    I would think the code for the 16i would run on the 18i without a problem. Have you tried it? Do you get alarms?

  3. #3
    Join Date
    Sep 2010
    Posts
    0
    I am getting a 2017 alarm, which is pretty much a generic alarm in my opinion. I have contacted Fanuc with no luck. The machine that is currently running this program is a Mori DL-151. The program works on one side but not on the other. So right now I am assuming that there are some parameters that perhaps have been turned on. I just ahve not had the time to compare the two yet. These programs are pretty interesting. I would like to have been inside the guys head when he was writing these.

  4. #4
    Join Date
    Jun 2008
    Posts
    1511
    Is there a description with the alarm or does the screen just show 2017? I agree with Dave that this should run without too many issues from the 16 to the 18 as they are pretty similar controls. Do you have any MTB manuals that can reference this alarm?

    Is the program long? Can you post it and show us where the alarm is being generated in the code?

    You don’t want to be inside the head of a macro guy, they are a bit off in the head if you know what I mean. I have dreams about macros. My wife says I’m sick.

    Stevo

  5. #5
    Join Date
    Sep 2010
    Posts
    0
    The alarm says machine/robot. It gives me that alarm for many various problems. We use the G70/G71 canned cycle with G42 and if you put in a TNR that it doesn't like that's the alarm you get. The 18i doesn't like to ROUND either and it gave me that alarm. To me it's a catch all.

    The program is pretty long. There are three separate programs. They end up being nested. I can try to post some of it. This one is the last of the three that sets the RPM and Feedrate.

    9090(SAVE)(RPM FEED)
    #137=ROUND[#4120/100.] <-----It stopped here and gave me a 2017 alarm
    #138=2900.+#137
    #139=#[#138] <-----So I changed this to a 1 to get past here
    #133=#13(DIR)
    #148=#19(RPM)
    #149=#9(FEED)
    IF[#139EQ1.]GOTO10
    IF[#139EQ3.]GOTO30
    #3000=9(ROTARY TOOL RATIO)
    N10(1 TO 1 RATIO)
    IF[#13GT1.]GOTO20
    #133=13.
    N20#140=240.(SFM)
    #141=3000.(MAX RPM)
    #142=3.5(FEED RT)
    GOTO40
    N30(1 TO 3 RATIO)
    IF[#13GT1.]GOTO35
    #133=14.
    N35#140=480.(SFM)
    #141=9000.(MAX RPM)
    #142=4.0(FEED RT)
    N40
    #143=[#18*3.1416]/12.(CIRCUM)
    #144=[#140/#143](RPM)
    IF[#144LE#141]GOTO50
    #144=#141(RPM EQ MAX)
    N50
    #145=[#144*#143](SFM)
    #146=[#142/[#140/#145]](FEED)
    IF[#19GT.01]GOTO100
    #149=#146-[SQRT[#18+#18]](FEED)
    #148=ROUND[#144/#139](RPM)
    N100M99 <---- Then I got another 2017 alarm here. I can't get past here now.

  6. #6
    Join Date
    Sep 2010
    Posts
    0
    This is the program that it is supposed to go back to:

    :9025(SAVE)(RADIUS OD SLOTS)
    (A=#1=OD DIA)
    (B=#2=SLOT DIA ACROSS)
    (C=#3=SLOT RADIUS)
    (D=#7=DEPTH)
    (E=#8=THICKNESS)
    (F=#9=FEED RATE)
    (I=#4=NUMBER OF SLOTS)
    (J=#5=ANGLE OFFSET -OPTIONAL)
    (K=#6=DEPTH OF CUT)
    (M=#13=SPINDLE DIRECTION)
    (R=#18=TOOL DIAMETER)
    (S=#19=SPINDLE RPM)
    IF[ABS[#5]GT0.]GOTO40
    #5=0.
    N40
    #15=0.
    IF[#18GT0.]GOTO70
    #15=ABS[#18](Z RAPID)
    #18=#3*2
    N70
    #110=.05+#18+#1(OD+TOOL+CLER)
    #120=#2(SLOT DIA)
    #122=#3-[#18/2](SL RAD-TOOL RAD)
    #123=#120+[#3*2](SLOT PLUS SLOT RAD)
    IF[[#18/2]LE#3]GOTO80
    #3000=1(DIM R LARGER THAN DIM C)
    N80
    IF[ABS[#5]LE360.]GOTO90
    #3000=2(J DIM GREATER THAN 360)
    N90
    IF[[#123+.05]LT#110]GOTO100
    #110=#123(START X)
    N100
    #10=0.(SLOT COUNT)
    #24=[360./#4](ANGLE)
    #25=#5
    N110
    IF[#6LT.01]GOTO120
    #14=#6
    IF[#14LT#7]GOTO160
    #3000=3(DEPTH OF CUT --- K)
    N120
    #14=#7
    N160
    G65P9090F#9M#13R#18S#19(SUB RPM FEED)
    G113
    M46
    M5
    G90G98G00X#110Z[#8+.1]
    M8
    M23
    G28H0
    G97S#148M#133
    N170(INDEX LOOP)
    G1X#110F30.
    G00C#25(ANGLE)
    G1Z[#8-#14]F50.
    G112
    G1C#122F50.
    X#123F#149
    IF[#122GT.0002]GOTO210(MUST GENERATE)
    N200
    IF[#15EQ0.]GOTO220(NO Z FEED)

    IF[#14EQ#7]GOTO205
    G1X#110F20.
    G113
    GOTO600
    N205

    G113
    N208
    G1Z[#8+.1]F#15
    GOTO600
    N210
    G3X#123C-#122R#122F#149
    N220
    G1X#110F[#149*2.]
    G113
    GOTO600
    N300
    G113
    G00Z[#8+.1]
    #10=[#10+1.]
    IF[#10EQ#4]GOTO500
    IF[#6LT.01]GOTO330
    #14=#6
    N330
    #25=[#25+#24]
    IF[#25LE360.]GOTO170
    #25=[#25-360.]
    GOTO170
    N500
    M5
    G113
    M24
    G00Z[#8+.1]
    M9
    G53Z-1.0
    M99
    N600(CHECK DEPTH)
    IF[#14EQ#7]GOTO300
    #14=#14+#6
    IF[#14LT#7]GOTO170
    #14=#7
    GOTO170

  7. #7
    Join Date
    Jun 2008
    Posts
    1511
    For one thing it is really weird that if it was actually the syntax of the macro code the machine will usually alarm out with a PS alarm related to Fanuc issues.

    I apologize but I am just finishing up and trying to get out of here on my first day off in weeks so at a quick glance I am going to give a few suggestions to try. Some of the suggestions should not matter code wise one way or the other as your code looks ok (where it is alarming) but I have seen some quirky things before.

    #137=ROUND[#4120/100.] <--- Try #137=ROUND[#4120]/[100.] I am not quick sure why he is using this function because #4120 is the variable for the modal T() value which I would not think would need to be rounded unless he is trying to strip any offset calls with it.

    #139=#[#138] <----Try #139=#[138] be careful with this one because it may be grabbing a value different then it was intended. Not sure what he is doing here without digging into the code. You typically use the # before the [ if you intend to keep valuing up and getting data from the next variable.

    N100M99 <----Not quite sure about this one. The only possible problem I see with this is the fact that when you are running program 9025 and it calls program 9090 and reads the N100M99 it is suppose to go back to program 9090 to block N100 however the N100 is before the G65P9090 and has already been read. I don’t think this should matter but I have never proven it.

    Good luck..I will check tomorrow if I can or someone else can jump in. If not I will try to strip everything down later.

    Stevo

  8. #8
    Join Date
    Sep 2010
    Posts
    0
    Thanks for the input. I will give it a try. I did need to turn on some parameters in the 18i. I'm not sure if I told you this or not but the program will run on one side of out Mori DL151, but not the other side. The guy that wrote this was ahead of his time in Macro programming and is no longer availble to help. I don't think he left the company on good terms.

    I hope you enjoy your day off.

    Thanks,
    Jackie

  9. #9
    Join Date
    Jun 2008
    Posts
    1511
    Yup…still here (chair)

    Ok now that I know that then there is probably nothing wrong with the syntax of the program. My guess is variables are not set properly or there is something specific from the MTB standpoint that it does not like something. If you are getting the same alarm on entirely different types of code then it is probably not the code.

    Stevo

  10. #10
    Join Date
    Sep 2010
    Posts
    0
    Alright. At the risk of sounding stupid, what is MTB? I'm really new at this and could use all the info that I can get.

  11. #11
    Join Date
    Jun 2008
    Posts
    1511
    No worries.

    Machine Tool Builder (MTB). In your case it's Mori.

    And yes I am still here. Told my wife I was leaving 3hrs ago.

    Stevo

  12. #12
    Join Date
    Sep 2010
    Posts
    0
    You're not going to have a wife for long. No wonder you dream about Macros.

    Now that I know what an MTB is almost makes sense. One machine is a Mori the other is a Wasino. But I still don't know why it works on one side of our DL151 and not the other side. This whole thing is really driving me nuts (short trip) and I've only been working on this for one week.

  13. #13
    Join Date
    Jun 2008
    Posts
    1511
    Ahhh…..she understands (most of the time).

    That’s why I asked about the MTB manual. You are going to have to dig a bit more in to that alarm to figure out how it is generated.

    1st week…huh, wait until you reach week 3 or 4. You will be fixing your problem with a BFH (big f$#n hammer). Well it won’t fix your problem but it does make you feel better.

    Now I am really leaving. I promise.

    Stevo

  14. #14
    Join Date
    Feb 2006
    Posts
    1792
    Read the alarm message on the screen.
    This is an MTB alarm, such as low lub problem.

    Sinha

  15. #15
    Join Date
    Feb 2006
    Posts
    1792
    You can read the alarm description on MDI screen. If needed, press the MESSAGE key. If you have MTB's manual, you will find it there also. Or, ask somebody who has exactly the same machine model.

    Sinha

  16. #16
    Join Date
    Sep 2010
    Posts
    0
    The alarm reads No.2017 (machine/robot). I am trying to get this to run a a Wasino A-12. It is currently working on a Mori DL151.

    We us G70/G71 canned cycle with tool compensation and if the operators enter the wrong TNR in the offset the Wasino will kick out the same alarm (2017).

    I haven't "played" with the program much the last couple of days. I have had a couple of other projects that took precedence this week. Hopefully tomorrow I can try again.

  17. #17
    Join Date
    Sep 2010
    Posts
    0
    I just read the message about the using MDI. I will give it a try.

  18. #18
    Join Date
    Sep 2010
    Posts
    0
    I tried running the program line by line and it gets to to #3000=9 and kicks out the alarm.

    The alarm says 3009 MACRO.

  19. #19
    Join Date
    Jun 2008
    Posts
    1511
    #3000 is the variable for an alarm generation. This is typically used with GOTO statements if a condition is not met. What you did not post is the #3000 in your program. These are typically posted at the end of the programs. What we will need to see is the N() address that is in front of the #3000=9 so then we can track back to the GOTON() statement and see the condition that is not being met.

    Stevo

  20. #20
    Join Date
    Sep 2010
    Posts
    0
    When I was going through the program line by line in MDI, I would check to see what value was being assigned to the variables. #139 was at zero. If you look the first two IF statements they were not met. Is this what you mean when you say a GOTO statement was not met?

Page 1 of 2 12

Similar Threads

  1. Custom Macro B
    By rlgx4 in forum Parametric Programing
    Replies: 7
    Last Post: 08-02-2010, 10:05 PM
  2. Custom Macro?
    By cncwhiz in forum Fanuc
    Replies: 9
    Last Post: 06-24-2010, 04:11 AM
  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 B On A 18t.
    By JIMMYZ in forum Fanuc
    Replies: 3
    Last Post: 10-19-2006, 04:08 AM
  5. custom macro
    By The Metal in forum Daewoo/Doosan
    Replies: 2
    Last Post: 09-28-2006, 01:26 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
  •