Paradigm | Procedural, imperative |
---|---|
Designed by | Massachusetts Institute of Technology |
Developer | Electronic Industries Association (RS-274), International Organization for Standardization (ISO-6983) |
First appeared | 1963 | (RS-274)
Filename extensions | .gcode, .mpt, .mpf, .nc and several others |
Major implementations | |
Numerous; mainly Siemens Sinumerik, FANUC, Haas, Heidenhain, Mazak, Okuma |
G-code (also RS-274) is the most widely used computer numerical control (CNC) and 3D printing programming language. It is used mainly in computer-aided manufacturing to control automated machine tools, as well as for 3D-printer slicer applications. The G stands for geometry. G-code has many variants.
G-code instructions are provided to a machine controller (industrial computer) that tells the motors where to move, how fast to move, and what path to follow. The two most common situations are that, within a machine tool such as a lathe or mill, a cutting tool is moved according to these instructions through a toolpath cutting away material to leave only the finished workpiece and/or an unfinished workpiece is precisely positioned in any of up to nine axes[1] around the three dimensions relative to a toolpath and, either or both can move relative to each other. The same concept also extends to noncutting tools such as forming or burnishing tools, photoplotting, additive methods such as 3D printing, and measuring instruments.