Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: deleteallusers on May 04, 2007, 05:17:21 PM

Title: How to add 1 to axis movment inline ?
Post by: deleteallusers on May 04, 2007, 05:17:21 PM
I got a program SOMTHING like this (SEE BELOW)

I'm trying to route LEVEL my work area.

I must add 1 to Y position and move Y 1 position more each loop
I do ... g00 y[+#1]  (Where #1 = 1 each loop and adds to the current value of Y)

and it's an error on the line.

I got to use a variable in the line position that changes each time I call the routine.

How do I do it ?

Thanks.


--------------------------------------------------
M98 P1001 L11.9844

M30
O10001

M98 P1002 L1
M98 P1003 L1

g00 x0
M99
;-------------------------
O1002
g00 x-1  (only moving 1.0 units)
M99

;-------------------------
O1003
g00 y[+#1]     ; THIS IS AN ERROR HERE HOW DO I DO IT ?
M99

Title: Re: How to add 1 to axis movment inline ?
Post by: Graham Waterworth on May 05, 2007, 02:03:19 PM
Try it like this :-

O1003
#1=#1+1
g00 Y#1     ; THIS IS AN ERROR HERE HOW DO I DO IT ?
M99

or

O1003
G91
G00 Y1.
G90
M99

Graham.