hi I decided to learn macro programming and I had a few ideas that I wanted to try. the machine I work with is a Mitsubishi meldas 300 it supports macros and has a page for common variables and local variables. The machine does not have cutter comp so im trying to make my own cutter comp program . here is the program, the alarm I get is p240 no variable. spec


O1000 (ANY OUTSIDE ARC WITH TOOL COMP)
#1=.5 (RADIUS OF CUTTER)
#2=1 (HEIGHT OFFSET)
#3=.1 (ZDEPTH)
#4=1. (RADIUS OF ARC)
#5=20. (FEED)
#6=1000 (RPM)
#7=54 (FIXTURE OFFSET)
#8=.5 (LEAD IN/OUT)

G00 G90 G[#7] X-[#4+#1+#8] Y0
S[#6]M03
G43 H[#2] Z.1
G01 Z-[#3] F[#5]
Y-[#8]
G03 X-[#4+#1] Y0. I0. J[#8]
G02 X[#4+#1] Y0. I[#4+#1]J0.
G02 X-[#4+#1] Y0. I-[#4+#1]J0.
G03 X-[#4+#1+#8] Y[#8] I-[#8] J0.
G01 Y0.
G00 Z1.
M30