528
7
7 Motion Control7.9 Format and Use of G-code Subprograms
G-code instructions support only immediate operands of the oating-point type (the immediate operands
can be converted to the target number of pulses according to the manually set conversion coefcient ).
Parameter Supported Floating-point Number Integer
32-bit integer -
G04 Pxxxx;
M98 Pxxxx Lxxxx;
(P and L can use only 32-bit integers, and their usage
is described in the following table.)
Floating-point number xxxx.xx -
Among function words used in G-code subprogram instructions, X, Y, and Z indicate the position, R
indicates the radius, I, J, and K indicate the center relative to the current position, and F indicates the feed
speed. All these input values are in mechanical unit, and the value range is limited. See the following table.
Motion Instruction Parameter Type Unit Range
X-axis position X (oating-point) mm
–9999.999 to –0.001,
0
0.001 to 9999.999
Y-axis position Y (oating-point) mm
–9999.999 to –0.001,
0
0.001 to 9999.999
Z-axis position Z (oating-point) mm
–9999.999 to –0.001,
0
0.001 to 9999.999
Offset of the center on the
x-axis
I (oating-point) mm
–9999.999 to –0.001,
0
0.001 to 9999.999
Offset of the center on the
y-axis
J (oating-point) mm
–9999.999 to –0.001,
0
0.001 to 9999.999
Offset of the center on the
z-axis
K (oating-point) mm
–9999.999 to –0.001,
0
0.001 to 9999.999
Radius R (oating-point) mm
–9999.999 to –0.001,
0.001 to 9999.999 (an error is returned
when the value is 0)
Running speed F (oating-point) mm/min
0.01 to 99999.99 (two decimals) (an error
is returned when the value is 0)
Major axis speed S (oating-point) r/min
0.01 to 99999.99 (two decimals) (an error
is returned when the value is 0)
Tool number T (integer) 0 to 9999
Number of the M98
subprogram
P (integer) 0 to 9999
G04 function word P (integer) 0 to 3,000,000
Number of subprogram calls L (integer) 0 to 9999
General M setting instruction M (integer) 100 to 7679
For better interaction between a general logic control program and a G-code program, the system supports
M element control by G-code and M element setting. M100 is used as an example. The logic control
program can take relevant action when M100 is ON, and can set M100 to OFF. M0 to M99 are reserved
key words for M code.