Hello Guest it is March 28, 2024, 02:44:28 PM

Author Topic: Macro wont load  (Read 2984 times)

0 Members and 1 Guest are viewing this topic.

Macro wont load
« on: October 18, 2010, 01:31:24 PM »
Hi All
Trying to write a hex milling macro the problem being I am not sure how to declare variables written program with similar format as I have done in the past but it does not seem to work as seen in screen shot can anyone tell me where I am going wrong please. Code is below & the reason to write macro is I cannot find a wizard to produce a hex, have licence for Mach 3 wizards but cannot see anything suitable  & I have a series of parts to make which will save a lot of time with macro.

(Hex Macro #1=a/f Size. #4=Z depth)
#1=38.0
#4=3
#1=[#1/2]
#2=[#1*TAN[30]]
#3=[#1/COS[30]]
G0 G21 G49 G40 G17 G80 G50 G90
M6 T2
G64
M03 S3500
G00 G43 H2 Z3.0
G42
G00 X#1 Y-[#2+10]
G01 Z-#4 F200.0
G01 Y#2 F60.0
G01 X0 Y#3
G01 X-#1 Y#2
G01 Y-#2
G01 X0 Y-#3
G01 X#1 Y-#2
G91
G1 X1.0 Y2.0
G90
G00 Z10.0
G40
M5
M30
%
 Thanks Ray

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Macro wont load
« Reply #1 on: October 18, 2010, 05:51:32 PM »
OK first this is not a macro(;-) it is a parametric gcode file.

this line  "  G00 X#1 Y-[#2+10] " is an error AS Mach does not recognize the - after the Y as a directional indicator(yea I know it should) You will need  to invert the value sign from inside the brackets to convert it to a negative number.

Try this  G00 X#1 Y[[#2+10]*-1]

I also see some more numbers that need converting as well.

I'll try your code later.

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Macro wont load
« Reply #2 on: October 18, 2010, 06:11:37 PM »
That should make it work. Don't forget to cancel the tool height offset(G49)


(Hex Macro #1=a/f Size. #4=Z depth)
#1=38.0
#4=3
#1=[#1/2]
#2=[#1*TAN[30]]
#3=[#1/COS[30]]
G0 G21 G49 G40 G17 G80 G50 G90
M6 T2
G64
M03 S3500
G00 G43 H2 Z3.0
G42
G00 X#1 Y[[#2+10]*-1]
G01 Z[#4*-1] F200.0
G01 Y#2 F60.0
G01 X0 Y#3
G01 X[#1*-1] Y#2
G01 Y[#2*-1]
G01 X0 Y[#3*-1]
G01 X#1 Y[#2*-1]
G91
G1 X1.0 Y2.0
G90
G00 Z10.0
G40

M5
M30
%
Re: Macro wont load
« Reply #3 on: October 19, 2010, 01:04:58 PM »
BR549
Your alterations loaded & ran spot on. Its always nice to learn something new.Many thanks
Ray

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Macro wont load
« Reply #4 on: October 19, 2010, 07:16:38 PM »
By the way GOOD JOB on your coding, nice to see the old ways are not dead yet(;-)

(;-) TP