Hello Guest it is March 28, 2024, 06:07:34 AM

Author Topic: pocket macro in g-code form  (Read 6069 times)

0 Members and 1 Guest are viewing this topic.

pocket macro in g-code form
« on: July 20, 2009, 09:30:58 AM »
Does anyone have a pocket macro in g-code (fanuc or mach) style?  Looking for something that will have a length, width, depth x,y position. Any and all help would be much appreciated.

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: pocket macro in g-code form
« Reply #1 on: July 20, 2009, 09:42:15 AM »
have you looked at the Wizards?
RICH
Re: pocket macro in g-code form
« Reply #2 on: July 20, 2009, 09:49:27 AM »
I know there are wizards, i need the actual macro written in g-code with if or while commands.  Is there a way to see the source code for the wizards?

vmax549

*
Re: pocket macro in g-code form
« Reply #3 on: July 20, 2009, 10:00:45 AM »
MACH cannot do direct conditional gcode programing, (;-(.  BUT I may have something you can use to cut squareish pockets.



(;-) TP
« Last Edit: July 20, 2009, 10:03:13 AM by vmax549 »
Re: pocket macro in g-code form
« Reply #4 on: July 20, 2009, 10:11:20 AM »
This is not for a Mach control.  I will use this on a Fanuc router.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: pocket macro in g-code form
« Reply #5 on: July 20, 2009, 11:40:04 AM »
You can look at the VB in the wizards by going into the wizard you wish and then Operator menu the Edit Button script. The Post code button should flash and when you look it should open the editor with the VB in it.
 Whether that will be any use for  your Fanuc I dont know.
Hood

vmax549

*
Re: pocket macro in g-code form
« Reply #6 on: July 20, 2009, 08:23:36 PM »
Try THis


#1=100(LENGTH)(A)
#2=200(WIDTH)(B)
#3=6.5(DEPTH)(C)
#17=20.6(TOOL DIA.)(Q)
#8=.7(TO CUT LESS THEN 1/2 CUTTER FOR OVERLAP)(E)
#21=2(Z PICK)(U)
#9=200(FEED)(F)
#23=.5(FINISH STOCK ON WALLS)(W)
#20=10(TOOL NUMBER)(T)



O0001(MAIN PROGRAM)
G65P9000A100B200C6.5Q20.6E.7U2F200W.5T10
M30

O9000(RECT. POCKET MACRO)
M6T#20
#10=[#17/2]-#8
#1=#1/2
#2=#2/2
#17=#17/2
#11=0(Y COUNTER)
#12=#21(Z COUNTER)
N100G0G90X0Y0Z1.
Z.1
G1Z-#12F#9
N200
WHILE[#11LT[#1-#17-#23]]DO1
#11=#11+#10
IF[#11GE[#1-#17/2-#23]]TH#11=[#1-#17-#23]
X-[#2-#17-#23]
Y-[#11-#23]
X[#2-#17-#23]
Y[#11-#23]
X-[#2-#17-#23]
Y0
END1
IF[#12EQ#3]GOTO300
#12=#12+#21
IF[#12GE#3]TH#12=#3
#11=0
GOTO100
N300
IF[#23EQ0]GOTO400
#23=0
GOTO200
N400G0Z1.
M99


(;-0 TP