« on: February 21, 2017, 02:57:54 PM »
I see what you mean. Our Grbl firmware doesn't support subroutines therefore the G-code BCL generates doesn't format its g-code into subroutines. That's why your g-code test with BCL failed.
I want to make some points about subroutines:
1. Subroutines were designed for human programmers or developers if you will, to make writing their code (not g-code) easier, more compact and more understandable/readable and maintainable by other humans. I suppose you could make a case for this code to include g-code, but I personally don't think of g-code this way.
2. Our laser machine G-code is designed to be 'streaming g-code' which means the g-code is fed to the laser machine starting from the top line and then feeding in every line, line by line, in sequence, until it reaches the last line.
3. Although it may, or can, get a little fuzzy, CAM software mainly is used to generate the g-code that is sent to your laser machine without the need or requirement for a human to modify it. A human can modify it if they wish, but in almost all cases, it isn't necessary to modify it before sending it to your laser machine.
I don't think there is a need to be concerned with whether the generated g-code is 1000 lines of code or 5000 lines of code.
Because of this important point #3 above, (CAM software generating all the g-code), there is no reason for CAM software to generate subroutine formatted g-code. A human isn't involved. The g-code isn't created for a human to read...it's created for a Grbl controller to receive and parse accordingly. But, I did say this could be a fuzzy area, since a human might want to edit the g-code.
To me, these points are the same whether I'm talking about generating g-code for a laser machine or for a 3D Printer.
To me, the only reason I could see to want to be able to create subroutine formatted g-code is if you were manually writing it and maintaining it for repeated use.
My understanding is that some of the more expensive CNC machines with expensive CAM software do support the concept of subroutines...but those are way above our low power laser machines, not only in cost, but in class.