If you have a big library of powerful snippets, you’ve got the potential for some real productivity enhancement. It’s kind of like delegating responsibility to that code snippet. You “call” that code, it does its thing, and then it “returns” to your main program to continue executing right after the call. Think of each as a way to access code sequestered in its own little mini-program. The G-Code language provides two different methods for doing this: subprogram calls and macro calls. To make g-code convenient for re-use, we need some way of centralizing it and then accessing it from the part program. First thing that happens is you need to change the code, perhaps to fix a bug, but you have copies of it scattered everywhere. You could try copying and pasting your code everywhere to reuse it, but that’s a mess. In the article on Parameterized Programming, we learned how to modify g-code so it can be used in many different situations through the use of variables. M98 & M99 G-Code: CNC Subprograms & Macro Calls CNCCookbook’s G-Code Tutorial Subprograms and Macro Calls for Code Building Blocks
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |