Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Josef on February 09, 2010, 04:13:43 AM

Title: How to set your own variables in a part program?
Post by: Josef on February 09, 2010, 04:13:43 AM
Hi everybody,

Since I'm new to Mach3 and already searched the forum, but couldn't find an answer, would be great if I could get some here.

Well I already did some GCode programming on some other platforms, so I wondered how I can set my own variables in a part program? Is it possible to set variables in a part program?

For example: K=3 (the variable K should be 3)
                  and then I use it
                  M=K  which gives me the same result as if I would typ the command M3

Is that possible in Mach3?

Thanks for the answers, I know it should be trivial but I just can't find an answer?

best Josef


Title: Re: How to set your own variables in a part program?
Post by: Graham Waterworth on February 09, 2010, 12:10:10 PM
You do it like this

To set a variable :-

#1=3 (use numbers #1 to #100  or #500 to #600)
#2=50
#3=[#1+#2]
#4=[0-10.5] (to set minus numbers)

To use that variable :-

G01 X[#4]
G02 X[#2] Y[#3] K[#1] F10. (etc.)

Graham
Title: Re: How to set your own variables in a part program?
Post by: olf20 on February 09, 2010, 06:08:47 PM
Thanks Graham, and Josef, I also wanted to know this.
olf20 / Bob