G codes and plot codes

The differences between and attributes of each. August 13, 2002

Q.
Why are G-codes preferable to plot codes in CNC work? I'd like to know more about each.

Forum Responses
Plot codes are generally lacking "Z" data for machining. They usually only define XY movement.



If by plot codes you mean HPGL (Hewlett-Packard Graphics Language...?), that is actually used by some of the lower cost router manufacturers. As you get into higher priced machines, the switch is made to G-code.


There are pros and cons to both systems. HPGL, by design, does not support Z axis commands and does not support multiple I/O commands. With that said, most people run a modified version of HPGL that supports the Z commands and supports I/O.

Why support HPGL? Most of the software in the POP and graphic arts industries is designed to support HPGL, AI and many other graphic formats. To integrate easily with these systems, it helps to support HPGL.

Why support M and G Codes? Metal working, woodworking and most manufacturing in general supports standard M and G codes. I guess "standard" is kind of a funny word here. The G Codes are standard, but about every machine manufacturer uses different M Codes.

G-Code is usually in user units. So if your machine is set up to run in inches, the code that it is looking for will be in inches. If your machine is set up in metric, the code that it is looking for will usually be in metric. One major advantage of this is that it makes it easier to read the code files if you need to.

HPGL is set up in HPGL units. For example, 1 inch usually equals 1016 HPGL units. It does not matter if your machine is set up in inches or metric - an HPGL unit is still an HPGL unit. Trying to read a file and edit it manually is more difficult in HPGL since most people do not think in HPGL units.

Is one language better than the other? Not really. Modified HPGL and G-Codes can produce the same parts with the same accuracy. It is kind of like saying that English is better than French. French is better if that is the language you speak. But the rest of us reading this page obviously believe English is better. We set up the MultiCam to interpret 3 languages directly. M and G codes, HPGL, and uCito, our own native language. This way, no matter what software you want to use, most likely we will support it. G-Codes are perceived to have the better value just because they have been used on machine tools forever and they are socially accepted.

CNC has been evolving for a while now. I think that we, the machine manufacturers, should get together and create a new language that is built on a standard. That way, it would not matter what machine you used or what controller you had - you could run the same file on any machine. Odds of this are pretty slim, but it is a nice thought. Would it not be cool to get a new software program and only need one post processor, the one that ran all the systems? It is a job shop dream.