G-code loop

New Home Forum Software Development G-code loop

This topic contains 2 replies, has 2 voices, and was last updated by  MIck 4 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35454

    MIck
    Participant

    I am using Arduino Mega2560 & Ramps 1.4.PC user.Sent my code with Repetier.

    Since I can control my MPCNC with Repetier, I started to write my own G-code. In the code, I tired to loop the code. I have tried M41, M98,99 and While loop. They don’t work…. Is there bug in my code? Is there a way to loop G code? or Repetier and Marlin do not support it.

    There is my code. Feel free to comment.

    ——————M41(not sure how to apply, require using SD card??)——————————
    G01 X10.0000 F500.000
    G01 Y10.0000 F500.000
    G01 X0.0000 F500.000
    G01 Y0.0000 F500.000
    M41

    —————While——————————————————–
    #100 = 1
    WHILE [#100 LE 5] DO1 ;(loop 5 times)

    G01 X10.0000 F500.000
    G01 Y10.0000 F500.000
    G01 X0.0000 F500.000
    G01 Y0.0000 F500.000
    #100 = #100 + 1 ;(Increase #100 by 1 each iteration of the loop)
    END1

    ————–M98 & M99—————————————————–
    M98 P2 L10 (call sub 10 times)

    G01 X10.0000 F500.000
    G01 Y10.0000 F500.000
    G01 X0.0000 F500.000
    G01 Y0.0000 F500.000

    M99
    ——————————————————————————

    #35458

    Ryan
    Keymaster

    Not in Marlin that I know of, I believe you have to have Mach3 for something like that.

    #35692

    MIck
    Participant

    Thank you for answering. Then, I will do it in the simple way-C&P.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.