G-Code

I put myself through college programming CNCs by hand (before PCs were available). Gcode is actually very simple. Basic examples that I recall:

A line of code can be made up of N,G,M,F,S,X,Y,Z,I,J,K components. Only one of each in a line. There are others that are machine/controler specific but these are the basic ones.

Nxxx, is the line number

Fxx, set feedrate X per minute.

Xxxxx, X axis command

Yxxxx, Y axis command

Zxxxx, Z axis command

Sxxxx, spindle speed

G90 places the controller in absolute coordinate space. All positional commands are relative to a single point in space, 0,0,0.

G91 places the controller in incremental coordinate space. The following move command will be done relative to the current position.

G00 the move command will be a rapid traverse to the X,Y,Z coordinates.

G01 linear move at the current programmed feed rate.

G02 clockwise arc move at the current feed rate. May require I,J,K coordinates.

G03 counter clockwise arc at the current feed rate. May require I,J,K coordinates.

M03 activate spindle clockwise

M04 activate spindle counter clockwise.

M05, spindle off

M30, end of program?

Example

N010 G90
N020 M03 G00 X1.0 Y-1.34
N030 Z-3.0
N040 G01 F10.0 X0.0 Y3.0
N050 G00 Z0
N060 X0 Y0 M05
N070 M30

I know there are some others but I think I last did this in 1982. But I think you can get the drift. Find an old CNC controller manual and there will be some good explainations.
 
Last edited:
Do a quick search for CAM software (Computer Assisted Machining) there are several packages that are quite cheap, and also have trial versions...

How many axis are in the system?
 

Similar Topics

Hi! I want to understand this code, who does is word. IF #"Sample timer".Q =1 THEN FOR #Ic := 1 TO 16 DO IF ((#Ic + 1) < 17) THEN //<...
Replies
7
Views
167
I'm working on learning OOP coding for TwinCat 3. I'd like to transfer and optimize the code my company has from AB Studio 5000 to ST TwinCat 3...
Replies
1
Views
101
in allen bradley kinetix 300 drive first E31 error shows after resting drive E11 error occurs need solution to reset E11 fault code
Replies
4
Views
174
Hello, I am trying to read a barcode scanner input using a cognex dataman 280 barcode reader, store it another string, the compare with another...
Replies
1
Views
109
Hi there, I'm new to plc programming and was wondering why I get this error code when I run my simulation for these temperature sensors? What I'm...
Replies
2
Views
106
Back
Top Bottom