Want to be a better CNC'er?
Get our weekly newsletter plus a package of greatest hits, special tips, and more, all for free.I'm Ready to Be a Better CNC'er, Hook Me Up!
One Shot G-Codes and Modal G-Codes
What Are G-Code Modes?
We've mentioned before that there are lots of "Modes" in G-Codes. A "Mode" simply means the CNC Controller is remembering some behavior from the last time you told it what to do. People often think modally, meaning if you don't specify every detail, they fall back to assuming you mean to do things the way you did the last time. Modes save time and make our g-code programs shorter.
When you run a G-Code program in the GWE simulator, it shows you which modes are in effect in the little box under the backplot:
The controller's state and G-Code Modes are shown Below the GWE Backplot...
There are many examples of modes in g-code, not the least of which are the coordinates of the current position. You don't always have to specify X, Y, and Z for every move. You only specify the coordinates that have actually changed.
The exact use of modes is one of the areas that differs from one G-Code Dialect to the next, so make sure you understand which things are modal in your g-code dialect and which are not.
What is a One-Shot G-Code?
Speaking of things which are not modal, we have a name for a big category of non-modal behavior which are called One-Shot G-Codes. A one-shot g-code is only in effect for the block it is used in, and then the mode goes back to whatever it was before the block was executed. Most of the one-shot g-codes are fairly advanced, so we'll save them for a later chapter.
1. Get out the programming manual for your control and find at least one example of a modal g-code and one example of a one-shot g-code.
No credit card required--just your name and email.
Next Article: CNC Editors
Do you want to be a better CNC'er in 37 Seconds?
Get Better Tool Life, Surface Finish, and Material Removal Rates Fast.
It's that easy. You can install and get results in a matter of minutes.