NC Code Makroprogrammierung Kreistasche

%
O9012(CIRCLE-POCKET)
IF[#3EQ#0]GOTO2001
IF[#9EQ#0]GOTO2002
IF[#23EQ#0]GOTO2003
IF[#1EQ#0]GOTO2004
N1G0X#24Y#25Z#1
#100=0
#106=0
#140=#5003
#141=#5001
#142=#5002
#144=#[#4107+2000](D+2000)
#10=#18-#144(POCKETRAD-EMRAD)
#143=#142-[#10-#4]
#145=[#10-#4]
#146=2*#145
#12=#23*[#144*2](WIDTH-OF-CUT)
#104=[#12*.01]
#27=#26+#5(ZDEPTH-FINISH)
IF[#7EQ2.0]#104=-#104
IF[#6EQ#0]GOTO3000
#100=ABS[FIX[[#26-#1+#5]/#6]]
#101=#100
N2G90G0Z#1
N3G0G90X#141Y#142
N500IF[#106GE#100]GOTO3000
#14=0
G91G1Z-#6F#3
WHILE[[#12+#14]LT[#145]]DO2
N4G1G91Y-#12F#3
#14=#14+#12
N5G#7X0Y[2*#14]R#14F#9
N6G#7X0Y-[2*#14]R#14
N31G0Y0.0
N32END2
N2000#106=#106+1
N19G90G1Y[#143]
G#7G91X0.0Y#146R145F#9
G#7X0.0Y-#146R145
G0Y0
N8G90G0X#141Y#142
N201GOTO500
N3000IF[#5EQ#0]GOTO4000
N9G90G0X#141Y#142
#14=0
N10G1Z#27F#3
N40WHILE[[#12+#14]LT[#145]]DO3
N11G1G91Y-#12F#3
#14=#14+#12
N12G#7X0Y[2*#14]R#14F#9
N13G#7X0Y-[2*#14]R#14
N14G0Y0
END3
N19G90G1Y#143
G#7G91X0.0Y#146R#145F#9
G#7X0.0Y-#146R#145
G0Y0
N4000G0G90X#141Y#142
N14G1Z#26F#3
#14=0
WHILE[[#12+#14]LT[#145]]DO1
G1G91Y-#12F#3
#14=#12+#14
G#7X0Y[2*#14]R#14F#9
G#7X0Y-[2*#14]R#14
G0Y0
END1
N1000IF[#4EQ#0]GOTO23(IFNOFINALLOW)
N19G90G1Y#143
G#7G91X0.0Y#146R#145F#9
G#7X0.0Y-#146R#145
G0Y0
IF[#5003NE#26]GOTO4000
N23G90G1Y[#142-#10]
N24G#7G91X0Y[2*#10]R#10F#9
N25G#7X0Y-[2*#10]R#10
N26G#7X#104Y[ABS[#104]]R[ABS[#104]]
N67G0G90Z#140
G0X#141Y#142
M99
N2001#3000=8(NO PLUNGE FEEDRATE GIVEN)
N2002#3000=3(NO FEEDRATE GIVEN)
N2003#3000=5(NO WIDTH OF CUT GIVEN)
N2004#3000=21(NO REFERENCE POINT)
M30
%