Welcome, Guest. Please login or register.
Did you miss your activation email?
February 13, 2012, 03:33:19 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  How to set your own variables in a part program?
Pages: 1   Go Down
Print
Author Topic: How to set your own variables in a part program?  (Read 424 times)
0 Members and 1 Guest are viewing this topic.
Josef
Active Member

Offline Offline

Posts: 2


View Profile
« 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


Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,655


West Yorkshire, England



View Profile WWW
« 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
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
olf20
Active Member

Offline Offline

Posts: 176


View Profile
« Reply #2 on: February 09, 2010, 06:08:47 PM »

Thanks Graham, and Josef, I also wanted to know this.
olf20 / Bob
Logged

Mach3, Atlas Knee Mill, 4th Axis, VcarvePro
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!