Chapter 7
104
UM10372_PCNC440_Manual_0221A
PROgRAMMiNg
7.2.7 Additional G-code Formatting Notes
7.2.7.1 Repeated Items
A line may have any number of G words, but two G words from the same modal group may not
appear on the same line. For more informaon, see Modal Groups later in this chapter.
A line may have zero to four M words. Two M words from the same modal group may not appear
on the same line.
For all other legal leers, a line may have only one word beginning with that leer.
If a parameter seng of the same parameter is repeated on a line, #3=15 #3=6, for example, only the
last seng takes eect. It is illogical but not illegal to set the same parameter twice on the same line.
7.2.7.2 Order of Execution
The order of items on a line does not determine the order of execuon on the commands. For more
informaon, see table Order of Execuon later in this chapter.
The three types of items whose order may vary on a line (as given at the beginning of this secon)
are word, parameter seng, and comment. Imagine that these three types of items are divided into
three groups by type.
The rst group (the words) may be reordered in any way without changing the meaning of the line
which is as dened above.
If the second group (the parameter sengs) is reordered, there is no change in the meaning of
the line unless the same parameter is set more than once. In this case, only the last seng of the
parameter takes eect. For example, aer the line:
#3=15 #3=6
has been interpreted, the value of parameter 3 is 6. If the order is reversed to
#3=6 #3=15
and the line is interpreted, the value of parameter 3 is 15.
If the third group (the comments) contains more than one comment and is reordered, only the last
comment is used. If each group is kept in order or reordered without changing the meaning of the
line, then the three groups may be interleaved in any way without changing the meaning of the line.
For example, the line:
G40 G01 #3=15 (foo) #4=-7.0
has ve items and means exactly the same thing in any of the 120 possible orders, such as #4=-
7.0 G01 #3=15 g40 (foo), for the ve items. The order of execuon of items on a line is
crical to safe and eecve mill operaon. If items occur on the same line, they are executed in a
parcular order. For more informaon, see Order of Execuon table later in this chapter.