Anybody now how a loop makes in mach. I need a short g-code string to make example X 20.00 in 0.5mm/loop down to 10.00
Can I do this in any M or G-code. (I was talking about turning)
Anybody now how a loop makes in mach. I need a short g-code string to make example X 20.00 in 0.5mm/loop down to 10.00
Can I do this in any M or G-code. (I was talking about turning)
i don't think you are being clear enough for people to understand what you want
from what your post looks like your trying to turn a taper?
This is not a taper or thread only normal turning from X20 to X10.
Well I don´t like write lot of code like this:
***** the sub text*******
N10 G00 Z0 X20
N20 G01 Z-10
N30 G00 X21
N40 G00 Z0
N50 G00 X 19.5
N60 G01 Z-10
and so on to X is 10.00
*********************
(if my cut on X is 0.5 I need to write this N10-N60 20 times![]()
In some machin you are writing a sub menu as Sinumerik G901 R3=10 P1.
Like IF THEN ELSE as Pascal or Basic code.
IF <X10 call ***SUB TEXT *** again, until I have 10.00 on X
Hope this explanation is better.
Sorry about my english![]()
this clears up what your looking for
it all depends on the capabilities of controller your using to do stuff like that
some times i write a block of g-code in note pad then copy-paste as many times as in need then go back and edit the line that needs to be incremented
i have also written things in basic to automatically index the cuts
do you have visual basic or any other basic software
i can send you an example
Thank´s holbieone.
I think if I hade been writing SUBROUTINE more people hade understand my question. The software I drive is Mach3. I found this on www.
www.artsoftcontrols.com/forum/index.php?
PHPSESSID=24644e697cb402c44ef2e650d300da9b&topic=3 10.0
S300 M3
M8
G00 G43 H3 Z1.00
G00 X1.0 Y2.0
M98 P1000
X2
M98 P1000
X3
M98P1000
M30
O1000
G01 F40 Z-.5
G01 F80 Z1.00
G04 P1.0
G00
M99
I copy this becaurse I think more people in the forum was understand my
"loop" question if they see the code from Brian Barker.
If you have another code I´m really intressted, so holbieone please write.
Regards
cnc_swe
This is the way I do it, or just use a wizard.
%Lathe Turning Multi-Pass
#1001=0 %zero
#1002=2 %feed rate
#1003=3 %loops
#1004=0.6 %cut distance
#1005=.010 %pullback
#1006=0.020 %size of cut
F#1002
G90
G1 x#1001z#1001 %Go to 0,0
M98 P321 Q#1003 %Run Subroutine
G90
M30
O321
G0 G91 x[-1*#1006]
G1 G90 z[-1*#1004]
G1 G91 x#1005
G0 G90 z#1001
G0 G91 x[-1*#1005]
M99
Ozzie
I just read what I posted and it's not exactly correct because it is very old, (before Mach), but you get the idea. By using relative and absolute moves you can accomplish what you're asking.
Using a wizard is much quicker.
Ozzie