What's new
What's new

Fanuc Error 114 Macro Help

leperkoopa

Plastic
Joined
Aug 31, 2023
I have recently been gifted a macro program to deal with all the very large weld preps of different sizes and angles that I need to make for my current employer

The maker of the macro was unable to test things, although it seems relatively simple and should work as intended when I load this on my Femco Horizontal mill with FANUC Oi-MB controller I get error code 114 "Format Error In Macro"
This is all very new to me so I know Im doing something wrong
Code is inserted below.

%
O3500
(WELD PREP MACRO)
(FANUC CONTROL)

(THIS PROGRAM WILL CUT A WELD PREP USING INSERT CUTTER WITH MATCHIN ANGLE TO PREP)
(I.E. A 45 DEG WELD PREP WILL USE A 45 DEG CUTTER)
(30 DEG WELD PREP USES A 30 DEG CUTTER)

(G54 "X" IS SET TO LEFT FACE)
(G54 "Y" IS SET THE CENTER OF THE PLATE)
(G54 "Z" IS SET TO THE FRONT FACE)

(TOOL NUMBER BEING USED IS T1 H1)

#100=9.1875 (#100 IS THE PART LENGTH IN X AXIS)
#101=1 (#101 IS PART DIMENSION IN Y AXIS)
#102=.5 (#102 IS THE DEPTH OF THE WELD PREP Z AXIS)

#105=45 (#105 IS THE WELD PREP ANGLE)
#106=.0625 (#106 IS THE FLAT DIM)

#110=.05 (#110 IS THE DEPTH PER CUT)
#111=1.25 (#111 IS THE CUTTER MINOR DIAMETER)

#112=1200 (#112 IS THE CUTTER RPM)
#113=10. (#113 IS THE FEED RATE IPM)




(----MACRO CALCULATIONS----)
(---DO NOT EDIT---)

#115=[#111/2] (#115 IS THE TOOL RADIUS)
#116=[#115*1.5] (#116 SETS THE TOOL CLEARANCE TO 1.5 TIMES DIA. X)
#117=[#100+[#116*2]] (#117 IS THE TOTAL TRAVEL FOR CUT X AXIS)

(Sin=Opp./Hyp. Cos=Adj./Hyp. Tan=Opp./Adj.)


#118=[TAN#105] (#118 CONVERTS PREP ANGEL TO A DECIMAL)
#119=[#118*#110] (#119 CALCULATES Y STEP BASED ON Z DEPTH)


IF[#106 EQ 0]GOTO 0002
#125=[#106/2] (#125 IS HALF THE FLAT DISTANCE)
GOTO 0003

N0002
#125=0

N0003

#126=[#125+#115] (#126 IS THE Y AXIS CONTROL)
#127=#110 (#127 IS THE Z AXIS CONTROL)

#130=[#102+#110] (#130 IS THE TOTAL Z DEPTH)


N0102 (START OF TOOL PATH)

G0 G90 G54 W2.0
X-#116 Y#126

G43 H1 Z3.
M3 S#112
Z.2 W0
M8

N0511 (START OF LOOP)
G0 G90 G54 X-#116 Y#126
G1 Z-#127 F#113
G1 G91 X#117
G0 G90 Y-#126
G1 G91 X-#117

#126=[#126+#119] (ADJUST Y FOR NEXT PASS)
#127=[#127+#110] (ADJUST Z FOR NEXT PASS)

IF [#127 LTE #130] GOTO 0511

G0 G90 Z3.
M5
M9
M30




%
 

rjwalker1973

Hot Rolled
Joined
Feb 2, 2016
Location
Florida
IF [#127 LTE #130] GOTO 0511

Shouldn't it be LE instead of LTE for less than or equal to?
IF [#127 LE #130] GOTO 0511 is the correct format I believe.




(Sin=Opp./Hyp. Cos=Adj./Hyp. Tan=Opp./Adj.)

When I was a very young machinist an older machinist showed me a very easy way to remember my basic trigonometry.
Oscar Has A Hairy Old Ass
20+ years later I have never forgot it.
 

rjwalker1973

Hot Rolled
Joined
Feb 2, 2016
Location
Florida
It was actually the Indian (Native American) Chief Sohcahtoa here.

Don't need images of Oscar's ass hanging around...
I never took a single trig class in high school. I learned from grumpy old machinist in the shop. Years later when I went back for my engineering degree I learned sohcahtoa.
 

rjwalker1973

Hot Rolled
Joined
Feb 2, 2016
Location
Florida
This solved it for me thank you so much!
Glad I could help. for reference these are the basic conditional expressions
EQ- Equal to
LT- Less than
GT- Greater than
GE- Greater than or equal too
LE- Less than or equal too
There are many more to learn but those are a start.
 

leperkoopa

Plastic
Joined
Aug 31, 2023
Glad I could help. for reference these are the basic conditional expressions
EQ- Equal to
LT- Less than
GT- Greater than
GE- Greater than or equal too
LE- Less than or equal too
There are many more to learn but those are a start.
This seems like such a powerful tool to use, and its something I feel would be really useful to me. Thank you for the help
 

rjwalker1973

Hot Rolled
Joined
Feb 2, 2016
Location
Florida
This seems like such a powerful tool to use, and its something I feel would be really useful to me. Thank you for the help
There is a thread pinned here on macro's that has a ton of information in it that could help you and yes macro's are a powerful tool.
 








 
Top