Content deleted Content added
m Dating maintenance tags: {{Too many see alsos}} |
m Reverted 1 edit by Natalielaurend (talk) to last revision by Alexander Davronov |
||
(19 intermediate revisions by 17 users not shown) | |||
Line 2:
{{other uses|G-code (disambiguation)|G programming language (disambiguation)}}
{{redirect|RS-274|the photoplotter format|Gerber format}}
{{More footnotes needed|date=January 2025}}
{{Ambox
| name = G-code
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| issue = This article may require restoring an older revision.
| talk = RfC:_Partially_Reversing_Thumperward's_deletions
| date = May 13, 2025
}}
{{Infobox programming language
| name = G-code
Line 10 ⟶ 19:
| developer = [[Electronic Industries Alliance|Electronic Industries Association]] (RS-274), [[International Organization for Standardization]] (ISO-6983)
| implementations = Numerous; mainly [[Siemens]] Sinumerik, [[FANUC]], [[Haas Automation|Haas]], [[Heidenhain]], [[Yamazaki Mazak Corporation|Mazak]], [[Okuma Corporation|Okuma]]
| dialects =
| influenced by =
| influenced =
| programming language =
| platform =
| operating system =
| license =
| website =
| wikibooks =
}}
'''G-code''' (abbreviation for '''geometric code'''; also called<ref>{{cite tech report |editor1-last=Barkmeyer |editor1-first=Edward J. |editor2-last=Hopp |editor2-first=Theodore H. |editor3-last=Michael J. |editor3-first=Pratt |editor4-last=Gaylen R. |editor4-first=Rinaudot |title=Background Study: Requisite Elements, Rationale, and Technology Overview for the Systems Integration for Manufacturing Applications (SIMA) Program |date=1995 |publisher=NIST Technical Series Publications |___location=Gaithersburg, MD, USA |pages=45 |edition=NIST Interagency/Internal Report (NISTIR) 5662 |url=https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir5662.pdf}}</ref> '''RS-274''',<ref>{{cite book |title=EIA Standard RS-274-D Interchangeable Variable Block Data Format for Positioning, Contouring, and Contouring/Positioning Numerically Controlled Machines |date=February 1979 |publisher=Electronic Industries Association |___location=2001 Eye Street, NW, Washington, D.C. 20006 |url=https://search.worldcat.org/de/title/11135300 |ref=RS-274-D}}</ref> standardized today in '''ISO 6983-1'''<ref>{{cite tech report |editor1-last=Technical Committee ISO/TC 184/SC 1 |title=ISO 6983-1:2009 Automation systems and integration — Numerical control of machines — Program format and definitions of address words; Part 1: Data format for positioning, line motion and contouring control systems |date=December 2009 |publisher=International Standards Organization |___location=Geneva, Switzerland |url=https://www.iso.org/standard/34608.html |ref=ISO 6983:2009}}</ref>) 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 tool]]s, as well as for [[Slicer (3D printing)|3D-printer slicer applications]]. G-code has many variants.
G-code instructions are provided to a [[Programmable logic controller|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 [[Metal lathe|lathe]] or [[Milling (machining)|mill]], a [[cutting tool (machining)|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<ref>Karlo Apro (2008). ''[https://books.google.com/books?id=Ws228Aht0bcC Secrets of 5-Axis Machining]''. Industrial Press Inc. {{ISBN|0-8311-3375-9}}.</ref> 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 (metalworking)|forming]] or [[Burnishing (metal)|burnishing]] tools, [[Gerber format|photoplotting]], additive methods such as
== History ==
The first implementation of a numerical control programming language was developed at the [[MIT Servomechanisms Laboratory]] in the 1950s. In the decades that followed, many implementations were developed by numerous organizations, both commercial and noncommercial. Elements of G-code had often been used in these implementations.<ref>{{cite book | last=Xu | first=Xun | date=2009 | url=https://
During the 1970s through 1990s, many CNC machine tool builders attempted to overcome compatibility difficulties by standardizing on machine tool controllers built by [[Fanuc]]. [[Siemens]] was another market dominator in CNC controls, especially in Europe. In the 2010s, controller differences and incompatibility
== Syntax ==
G-code began as a limited language that lacked constructs such as loops, conditional operators, and programmer-declared variables with [[Natural language|natural]]-word-including names (or the expressions in which to use them). It was unable to encode logic but was just a way to "connect the dots" where the programmer figured out many of the dots' locations longhand. The latest implementations of G-code include macro language capabilities somewhat closer to a [[high-level programming language]]. Additionally, all primary manufacturers (e.g., Fanuc, Siemens, [[Heidenhain]]) provide access to [[programmable logic controller]] (PLC) data, such as axis positioning data and tool data,<ref>{{cite web
== Extensions and variations ==
Line 39 ⟶ 48:
Extensions and variations have been added independently by control manufacturers and machine tool manufacturers, and operators of a specific controller must be aware of the differences between each manufacturer's product.
One standardized version of G-code, known as ''BCL'' (Binary Cutter Language), is used only on very few machines. Developed at MIT, BCL was developed to control CNC machines in terms of straight lines and arcs.<ref>{{Cite book|url=https://books.google.com/books?id=GE8vBQAAQBAJ&q=binary+cutter+language+gcode&pg=PA321|title=Information Technology Standards
Some CNC machines use "conversational" programming, which is a [[wizard (software)|wizard]]-like programming mode that either hides G-code or completely bypasses the use of G-code. Some popular examples are Okuma's Advanced One Touch (AOT), Southwestern Industries' ProtoTRAK, Mazak's Mazatrol, Hurco's Ultimax and Winmax, Haas' Intuitive Programming System (IPS), and Mori Seiki's CAPS conversational software.
== See also ==
* [[Canned cycle]]
* [[Direct Numerical Control]]
* [[LinuxCNC]]
* [[List of computer-aided manufacturing software]]
== References ==
{{Reflist}}
== Bibliography ==
* {{MachinerysHandbook25e}}
* {{Smid2008}}
* {{Smid2010}}
* {{Citation |last=Smid |first=Peter |year=2004 |title=Fanuc CNC Custom Macros |publisher=Industrial Press |url=https://books.google.com/books?id=YKvH-zYd3VwC&pg=PR11 |isbn=978-
== External links ==
* [http://carlsonmfg.com/cnc-g-code-m-code-programming CNC G-Code and M-Code Programming]
* {{Citation |last1=Kramer |first1=T. R. |last2=Proctor |first2=F. M. |last3=Messina |first3=E. R. |title=The NIST RS274NGC Interpreter – Version 3 |date=1 Aug 2000 |id=NISTIR 6556 |journal=[[NIST]] |url=https://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 |ref=none}}
* http://museum.mit.edu/150/86 {{Webarchive|url=https://web.archive.org/web/20160319102859/http://museum.mit.edu/150/86 |date=2016-03-19 }} Has several links (including history of MIT Servo Lab)
* [http://reprap.org/wiki/G-code Complete list of G-code used by most 3D printers] at reprap.org
* [http://www.cnccookbook.com/CCCNCGCodeList.html Fanuc and Haas G-code Reference]
* [http://www.cnccookbook.com/CCCNCGCodeCourse.htm Fanuc and Haas G-code Tutorial]
|