I would think the code for the 16i would run on the 18i without a problem. Have you tried it? Do you get alarms?
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!!!![]()
I would think the code for the 16i would run on the 18i without a problem. Have you tried it? Do you get alarms?
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.
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
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.
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
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
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
Yup…still here
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
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.
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
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.