Chapter 7
90
UM10349_PCNC1100_Manual_0916A
Programming
Feed and Speed Override Controls
The operang system has commands which enable (M48) or disable (M49) the feed and speed
override slider controls. It is useful to be able to override these for some machining operaons.
Default sengs in the program are set and the operator should not change them.
7.2 G-code Programming Language
IMPORTANT! Do not use a word processor to create or edit G-code les. A word processor leaves unseen
codes that cause problems and may prevent a G-code le from working. Use a text editor like Gedit or
Notepad++ to create or edit les.
7.2.1 Overview
The programming language of the mill is known as G-code. A G-code program is composed of one
or more lines of code. Each line (called a block) may include commands to the machining system to
do several dierent things. Blocks may be collected in a le to make a program.
A typical block consists of an oponal line number at the beginning followed by one or more words.
A word consists of a leer followed by a number (or strictly speaking, something that evaluates to a
number). A word may either give a command or provide an argument to a command. For example,
G01 X3 is a valid line of code with two words. G01 is a command meaning move in a straight line at
the programmed feed rate, and X3 provides an argument value (the value of X should be 3 at the
end of the move). Most commands start with either G (general) or M (miscellaneous). The words for
these commands are called G-codes and M-codes.
The language has two commands (M02 or M30), execuon of either of which ends a program. A
program may end before the end of a le. Lines of a le that occur aer the end of a program are
not to be executed in the normal ow, so generally they’re parts of subrounes.
7.2.2 Block
A block (or equivalently line) of code is a secon of programming language elements that are
grouped together into a single statement. A program consists of one or more blocks, each separated
by a line break. Blocks in a program are executed sequenally from top to boom or unl an end
command (M02 or M30) is encountered.
7.2.3 Real Value
A real value may be an explicit number (such as 341 or -0.8807), a parameter value, an expression
or a unary operaon value. Denions of these follow in the Word Inial Leers table.
7.2.4 Number
Numbers are a subset of real values. Processing a real value to come up with a number is called
evaluang. An explicit number evaluates to itself.