603,546 active members*
3,468 visitors online*
Register for free
Login
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2006
    Posts
    121

    I need make a loop in Mach

    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)

  2. #2
    Join Date
    Feb 2007
    Posts
    664
    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?

  3. #3
    Join Date
    Jan 2006
    Posts
    121

    Unhappy The loop I was looking for

    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

  4. #4
    Join Date
    Feb 2007
    Posts
    664
    Quote Originally Posted by cnc_swe View Post
    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

  5. #5
    Join Date
    Jan 2006
    Posts
    121

    I found the answer

    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

  6. #6
    Join Date
    Jul 2004
    Posts
    442
    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

  7. #7
    Join Date
    Jul 2004
    Posts
    442

    Not exactly correct

    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

Similar Threads

  1. Confused: Mach Turn, Mach Mill, Mach 2/3 ?
    By CanSir in forum Mach Software (ArtSoft software)
    Replies: 5
    Last Post: 02-16-2007, 11:41 AM
  2. Mach 3 closed loop ?
    By efrem in forum Mach Mill
    Replies: 5
    Last Post: 12-07-2006, 02:01 AM
  3. Lathe conversion - open loop vs closed loop
    By bhowden in forum Uncategorised MetalWorking Machines
    Replies: 7
    Last Post: 03-21-2006, 10:56 PM
  4. Closed loop....open loop?
    By DAB_Design in forum CNC Machine Related Electronics
    Replies: 10
    Last Post: 06-26-2004, 10:02 PM
  5. Closed Loop Driver vs. Closed Loop Computer
    By ojibberish in forum Gecko Drives
    Replies: 3
    Last Post: 06-08-2004, 05:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •