Hello Guest it is March 28, 2024, 08:49:08 AM

Author Topic: How to set your own variables in a part program?  (Read 3673 times)

0 Members and 1 Guest are viewing this topic.

How to set your own variables in a part program?
« 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


Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: How to set your own variables in a part program?
« Reply #1 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
Without engineers the world stops

Offline olf20

*
  •  325 325
    • View Profile
Re: How to set your own variables in a part program?
« Reply #2 on: February 09, 2010, 06:08:47 PM »
Thanks Graham, and Josef, I also wanted to know this.
olf20 / Bob
Mach3, Atlas Knee Mill, 4th Axis, VcarvePro, ESS, Super PID.
Been Heating with corn since 1998