Hello Guest it is June 25, 2019, 12:34:47 AM

Author Topic: How to set your own variables in a part program?  (Read 2272 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

*
  • *
  •  1,861 1,861
  • 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
Never give up, time will pass, the cloud will clear, the sun will shine once more.

Offline olf20

*
  •  317 317
    • 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