how to loop G-code

hello,

I am using Grbl Control V0.5.2 to communicate with my Protoneer G-shield running grbl v9 on an Arduino Uno R3. I am trying to just make a simple loop to plane the top of a piece of wood I'm working on.

Here is what I have to loop.

N000 M3 N100 F5980 N200 G91 X330 N300 G90 N400 G91 X-330 N500 G90 N600 G91 Y-1 N800 G90

That's what I have.

Now I want that to repeat 320 times then end.

everone: hello,

I am using grbl control to communicate with my Protoneer breakout. I am trying to just make a simple loop to plane the top of a piece of wood I'm working on.

here is what I have to loop.

N000 M3 N100 F5980 N200 G91 X330 N300 G90 N400 G91 X-330 N500 G90 N600 G91 Y-1 N800 G90

That's what I have.

now I want that to repeat 320 times then end.

And what does this have to do with Arduinos?

I don't think G-code has loops. It's not a programming language.

Your thing which produced that code has to write it out 320 times. If you wrote it by hand, then I hope you can copy-paste.

MorganS: I don't think G-code has loops.

It has.

An if the OP took the trouble to Google "GCode loop" he would probably find out how.

...R

ok first off it has to do with Arduino because the build is built off of an UNO R3 and a Protoneer gsheild is my 100% Grbl compatible Arduino shield. so I answered both of those questions. next I have googled GCODE LOOP! all the ways I have seen are not working for me so if you seem to know the answer please don't act mighty. please share. how do you think it should work?

everone: next I have googled GCODE LOOP! all the ways I have seen are not working for me so if you seem to know the answer please don't act mighty.

I don't know the answer, but I'm sure I could find the answer.

You say you have a problem but you have not posted any code to show exactly what you have tried and where you are stuck. A link to the website where you got your idea from would also help so we can all read the same page.

Where is the GCode stored? Is it on an SD Card? or is it being generated directly by a PC or an Arduino?

...R

Yes there is a loop function in Gcode, however I don’t think it is implemented in many implementations of the language including the one you are using.