Gcode in PlanetCNC TNG software

PlanetCNC TNG is a motion control software intended for control of CNC machines. As a standard, g-code is used as native programming language.

PlanetCNC TNG software processes gcode program and sends series of commands to motion controller. Controller interprets these commands and arranges coordinated machine motion.

 

Gcodes

G-code commands can be divided into multiple groups which differ from one another based on functionality and intended use.

Single G-code line, aka block, can include commands for modal state configuration, machine motion, program control and data manipulation, or peripheral control.
PlanetCNC TNG supports also gcode functions, expression functions, parameters, operators etc…

 

List of Gcode groups:
G-codes (G21,G17,G90, G00,G01…)
M-codes (M3,M5,M6…)
Other codes (F,S,T)
O-words (SUBROUTINE, CONDITION…)
Comments (LOGCREATE,LOG…)
Operators (+,-,EQ,GT,AND…)
G-code functions (Exists, Sin, Cos, Inc, Dec…)
Expression functions (infoIsInitialized, infoMachinePosition…)

 

Complete list of gcode commands and system parameters is available in PlanetCNC TNG G-code reference manual. This document is located in Doc folder of PlanetCNC TNG main installation folder. 

 

Simple g-code programs (i.e. toolpaths) can be easily written manually. For this purpose we recommend that users gets at least familiar with g-code. Get to know groups of g-code commands, syntax, format and programming guidelines. Even if user does not have an intention of manually writing his g-code programs, it can be in great help when debugging and understanding program and machine behaviour.

 

We really encourage our users that they explore PlanetCNC TNG scripts, they are a really great source for discovering different types of gcode programming and programming approaches. Single script code can offer a lot of new knowledge for a curious CNC beginner as also for a well rounded programmer.

More about accessing and configuration of scripts can be read here:
Accessing script files in PlanetCNC TNG