CAMotics Online

3 G-code

3.1 How CAMotics reads G-code

CAMotics reads G-code in the dialect of LinuxCNC. Most programs from CAM software for LinuxCNC, Mach3, Mach4 and similar controllers run without changes. This chapter tells you what CAMotics does with each part of a program. Where CAMotics and LinuxCNC are different, this chapter tells you what CAMotics does.

For the full LinuxCNC documentation, refer to the LinuxCNC G-code overview.

3.1.1 Blocks and words

A program is a list of lines. Each line is one block. A block can have:

  • An optional block delete character / at the start.
  • An optional line number, the letter N and an integer, after the /.
  • Words. A word is a letter and a value, for example G1, X10.5 or F600.
  • Parameter assignments, for example #1 = 5.
  • One O-word command, for example o100 while [#1 LT 5].
  • Comments.

The letters can be uppercase or lowercase. Spaces and tabs between the parts of a word have no effect: X 1 0 is the same as X10. A value can be a number, a parameter such as #1 or #<depth>, or an expression in square brackets, such as [#1 * 2].

CAMotics ignores the line numbers. It ignores the % character in all positions.

3.1.2 Block delete

CAMotics does not run a block that starts with /. There is no switch to turn this off.

G-code
/G0 X100 (CAMotics does not run this block)

3.1.3 The order of execution in a block

The position of a word in a block has no effect. CAMotics does the parts of a block in this order:

  1. Parameter assignments, from left to right.
  2. The special comment, such as (MSG,...).
  3. G7, G8, G96 and G97.
  4. The feed rate F.
  5. The spindle speed S.
  6. The tool selection T.
  7. M62 to M68 (outputs and inputs).
  8. M6 and M61 (tool change).
  9. M3, M4 and M5 (spindle).
  10. M70 to M73 (modal state).
  11. M7, M8, M9, M7.1 and M8.1 (coolant).
  12. M48 to M53 (overrides).
  13. M100 to M199.
  14. G4 (dwell).
  15. G17 to G19.1 (plane).
  16. G20, G21, G70 and G71 (units).
  17. G40 to G42.1 (cutter radius compensation).
  18. G43 to G49 (tool length offset).
  19. G54 to G59.3 (coordinate system).
  20. G61, G61.1 and G64 (path mode).
  21. G90, G90.1, G91 and G91.1 (distance mode).
  22. G98 and G99 (canned cycle retract).
  23. G10, G28 to G30.1, G52, G53, G92 to G92.3 and G93 to G95.
  24. The motion: G0 to G5.3, G33, G38.x, G73, G76 and G80 to G89.
  25. M0, M1, M2, M30 and M60 (stop and end).

If a block has axis words and no motion code, CAMotics uses the current motion mode. This is the "modal" motion. CAMotics does not do this if the block has a code from the non-modal group (refer to Modal groups). Thus G64 X10 does not move the tool.

3.1.4 Errors and warnings

CAMotics shows a warning when it finds a problem that it can continue after. Some examples are an unknown code, a code that it does not run, or two codes from one modal group in a block. For two codes from one modal group, CAMotics uses the first code and ignores the second.

CAMotics shows an error when it cannot do a block, for example a syntax error. It does not do that block and continues with the next block. After 32 errors, it stops. If the program has one or more errors, the toolpath job fails.

The online simulator shows at most 100 warnings.

3.1.5 Limits of the online simulator

The online simulator limits the work of one job:

  • At most 50 000 000 G-code lines run. CAMotics counts each line each time that it runs, also in loops and subroutines.
  • At most 10 000 000 O-word loop iterations.

The server settings can change these limits. A job that exceeds a limit stops with an error, for example "G-code exceeded the limit of 50000000 lines".

3.1.6 Default state

At the start of a program, the state of CAMotics is:

ModeDefault
Motion modeG1
PlaneG17 (XY)
UnitsG21 (millimeters)
Distance modeG90 (absolute)
Arc center distance modeG91.1 (incremental)
Feed rate modeG94 (units per minute)
Cutter radius compensationG40 (off)
Tool length offsetG49 (off)
Coordinate systemG54
Canned cycle retractG99 (to R)
SpindleM5 (off), G97 (RPM)
CoolantM9 (off)
Feed rate and spindle speed0

A modal code stays active until a different code from the same group replaces it. A block can have only one code from each group. The non-modal group has codes that have an effect only in their block, and codes that CAMotics does not put in a group.

GroupCodes
MotionG0, G1, G2, G3, G5, G5.1, G5.2, G5.3, G33, G33.1, G38.2 to G38.9, G73, G76, G80 to G89
PlaneG17, G17.1, G18, G18.1, G19, G19.1
Lathe diameterG7, G8
DistanceG90, G91
Arc distanceG90.1, G91.1
Feed rate modeG93, G94, G95
UnitsG20, G21, G70, G71
Cutter radius compensationG40, G41, G41.1, G42, G42.1
Tool length offsetG43, G43.1, G43.2, G49
Canned cycle returnG98, G99
Coordinate systemG54, G55, G56, G57, G58, G59, G59.1, G59.2, G59.3
StopM0, M1, M2, M30, M60
Tool changeM6, M61
SpindleM3, M4, M5
CoolantM7, M7.1, M8, M8.1, M9
OverrideM48, M49, M50, M51, M52, M53
Non-modalG4, G10, G28 to G30.1, G52, G53, G61, G61.1, G64, G92 to G92.3, G96, G97, M62 to M68, M70 to M73, M100 to M199

3.3 Units

G20 sets the units to inches. G21 sets the units to millimeters. The units apply to axis words, arc words, offsets and the feed rate.

A G-code program in CAMotics always starts in millimeters (G21). The units of the project do not change this. If your program is in inches, put G20 near the start of the program.

G70 and G71 are the Mach3 and Mach4 codes for inches and millimeters. CAMotics reads them as G20 and G21. In LinuxCNC, G70 and G71 are lathe cycles.

The parameters #<_metric> and #<_imperial> show the current units. Their values are 1 or 0.

3.4 Coordinate systems and offsets

CAMotics adds these offsets to a position that you program, in this order:

  1. The offset of the current coordinate system, G54 to G59.3.
  2. The tool length offset, G43.
  3. The G92 or G52 offset, if it is on.

3.4.1 Coordinate systems G54 to G59.3

There are nine coordinate systems. G54 selects system 1, G55 system 2 and up to G59.3, system 9. G54 is the default. At the start, all offsets are zero.

To set the origin of a coordinate system, use G10 L2 or G10 L20. G10 L2 sets the offset to the values that you give. G10 L20 calculates the offset so that the current position gets the values that you give.

G-code
G10 L2 P1 X50 Y20 Z0 (The origin of G54 is at machine X50 Y20)
G54 G0 X0 Y0          (Moves to machine X50 Y20)

G10 L2 can also rotate a coordinate system around the Z axis. Use the R word, in degrees.

3.4.2 Machine coordinates G53

G53 makes one G0 or G1 move in machine coordinates. CAMotics ignores all offsets for this move. Put G53 in the same block as G0 or G1.

3.4.3 G92 and G52 offsets

G92 sets an offset on all coordinate systems, so that the current position gets the values that you give. The tool does not move. G92.1 cancels the offset and sets it to zero. G92.2 cancels the offset, but keeps its values. G92.3 applies the kept values again.

G52 sets the same offset directly to the values that you give. G92 and G52 share the parameters #5211 to #5219.

3.4.4 Tool length offset

G43 applies the tool length offset from the tool table. G43 H2 applies the offset of tool 2. G43.1 applies offsets that you give with axis words. G43.2 adds the offset of a second tool. G49 cancels the tool length offset.

3.5 Feed rate and spindle speed

F sets the feed rate. In G94 mode (the default), the feed rate is in units per minute: mm/min with G21 and in/min with G20. G0 moves do not use the feed rate.

If a G1, G2 or G3 move occurs while the feed rate is 0, CAMotics shows a warning and uses 10 mm/min.

G93 (inverse time) and G95 (units per revolution) are feed rate modes. CAMotics records these modes and the toolpath is correct. But the time estimate does not support them. CAMotics shows a warning and uses F as units per minute.

S sets the spindle speed in revolutions per minute. M3 starts the spindle clockwise, M4 counterclockwise, and M5 stops it. G96 sets constant surface speed mode, and G97 sets RPM mode. The simulator cuts the workpiece also when the spindle is off.

3.6 Tool changes

T selects a tool. M6 changes to the selected tool. You can put T and M6 in the same block, because CAMotics does T before M6.

G-code
T2 M6 (Change to tool 2)

The simulator uses the tool table of the project. For the shape and the size of each tool, refer to the tool table in the project settings.

  • If M6 occurs before a T word, CAMotics shows the error "No tool selected".
  • If the program makes a feed move before the first tool change, CAMotics shows a warning and uses tool 1.
  • If the tool table does not have the tool number, CAMotics uses a cylindrical tool of 2 mm diameter and 10 mm length. Add the tool to the tool table to get the correct shape.

G10 L1, G10 L10 and G10 L11 change the tool offsets that G43 uses. They do not change the tool shape in the simulation.

3.7 Arcs and helixes

G2 makes a clockwise arc. G3 makes a counterclockwise arc. The arc is in the current plane. G17 selects the XY plane (the default), G18 the ZX plane and G19 the YZ plane. G17.1, G18.1 and G19.1 select the UV, WU and VW planes.

3.7.1 Center format

Give the end point with the axis words and the center with the offset words. In the XY plane, the offset words are I and J. In the ZX plane, they are I and K. In the YZ plane, they are J and K.

In G91.1 mode (the default), the offsets are from the start point to the center. In G90.1 mode, the offsets are the position of the center.

G-code
G0 X10 Y0
G2 X0 Y-10 I-10 J0 F600 (Quarter circle around X0 Y0)

If the end point is not on the circle, CAMotics shows a warning when the difference is more than 0.005 mm (or 0.0005 in). It continues with the arc.

3.7.2 Radius format

Give the end point and the radius with the R word. A positive R makes an arc of 180 degrees or less. A negative R makes an arc of more than 180 degrees. You cannot make a full circle in radius format.

If R is too small for the two points, CAMotics shows a warning and makes a straight line.

3.7.3 Full circles, turns and helixes

If the end point is the same as the start point, the arc is a full circle. The P word sets the number of turns. P2 makes two full turns.

If you give the axis that is perpendicular to the plane (Z in the XY plane), the tool moves on that axis at the same time. This makes a helix.

G-code
G0 X5 Y0 Z0
G2 X5 Y0 I-5 J0 Z-3 P3 F400 (Three turns down to Z-3)

3.7.4 Example: a pocket with arcs

This program cuts a round pocket with a helix entry and a rounded rectangle.

pocket.nc
(A round pocket and a rounded rectangle, metric)
G21 G90 G17 G94
T1 M6
S12000 M3
G0 Z5

(Round pocket: diameter 20 mm, depth 3 mm, center X25 Y25)
G0 X26 Y25
G1 Z0 F300
G2 X26 Y25 I-1 J0 Z-3 P3 F600
G2 X26 Y25 I-1 J0
G1 X28.5
G2 X28.5 Y25 I-3.5 J0
G1 X31
G2 X31 Y25 I-6 J0
G1 X33.5
G2 X33.5 Y25 I-8.5 J0
G0 Z5

(Rounded rectangle 40 x 20 mm, corner radius 5 mm, depth 1 mm)
G0 X55 Y10
G1 Z-1 F300
G1 X85 F600
G3 X90 Y15 I0 J5
G1 Y25
G3 X85 Y30 I-5 J0
G1 X55
G3 X50 Y25 I0 J-5
G1 Y15
G3 X55 Y10 I5 J0
G0 Z5

M5
G0 X0 Y0
M2

3.8 Canned cycles

A canned cycle drills or bores one hole in one block. The cycle stays active. Each next block with X or Y words does the cycle again at the new position. G80 cancels the cycle.

The words of a cycle are:

WordDescription
X, YThe position of the hole.
ZThe bottom of the hole.
RThe retract plane. The tool goes down to R at the rapid rate.
LThe number of times to do the cycle. The default is 1.
PThe dwell at the bottom, in seconds (G82, G86, G89).
FThe feed rate.

CAMotics keeps the values of Z, R and P from the last block that had them. Thus the next blocks can give only X and Y.

G98 and G99 set the retract after each hole. With G99 (the default), the tool goes back to R. With G98, the tool goes back to the Z position from before the cycle, if this is above R. Otherwise it goes back to R.

CAMotics runs these cycles fully: G81, G82, G85, G86 and G89.

3.8.1 Example: drill a pattern of holes

drill.nc
(Drill a pattern of holes with canned cycles, metric)
G21 G90 G17 G94
T1 M6
S8000 M3
G0 Z10
G0 X10 Y10

(G99: retract to R between holes)
G99 G81 X10 Y10 Z-5 R2 F200
X20
X30
X40

(G82: dwell 0.5 s at the bottom of each hole)
G82 X10 Y25 Z-3 R2 P0.5
X20
X30
X40
G80

G0 Z10
M5
M2

3.9 Comments and messages

CAMotics reads two types of comments:

  • ( ... ): the text between the parentheses. A parenthesis comment can be in the middle of a block. In CAMotics, it can also continue on the next lines.
  • ;: the text from ; to the end of the line.

3.9.1 Special comments

A parenthesis comment that starts with a keyword and a comma is a special comment. CAMotics reads only the last comment in a block as a special comment. The keyword can be uppercase or lowercase.

CommentWhat CAMotics does
(MSG, text)Sends the text as a message.
(DEBUG, text)Puts the values of the parameters in the text, then sends it as a message.
(PRINT, text)Puts the values of the parameters in the text, then writes it to the log.
(LOGOPEN, file), (LOGAPPEND, file), (LOGCLOSE), (LOG, text)Write to a log file on the server.
(PROBEOPEN file)Shows a warning. CAMotics does not support it.
G-code
#<depth> = 3
(DEBUG, The depth is #<depth>)

3.10 Parameters and expressions

A parameter keeps a number. You can use a parameter in place of a number in a word or an expression.

3.10.1 Numbered parameters

Numbered parameters are #1 to #5601. The number can be an expression, for example #[#1 + 1]. A number out of this range causes an error.

G-code
#1 = 10
G1 X#1 Y[#1 / 2] F600

Some numbered parameters have a special function, as in LinuxCNC:

ParametersContents
#5061 to #5069The probe result position.
#50701 if the probe found contact, else 0.
#5161 to #5169The G28 position.
#5181 to #5189The G30 position.
#52101 if the G92 offset is on.
#5211 to #5219The G92 offset.
#5220The current coordinate system, 1 to 9.
#5221 to #5230The offsets and the rotation of coordinate system 1. Systems 2 to 9 follow in steps of 20.
#5399The result of M66.
#5400The current tool number.
#5401 to #5409The tool offsets.
#5420 to #5428The current position.

3.10.2 Named parameters

A named parameter has a name in angle brackets, for example #<depth>. CAMotics ignores spaces and uppercase in the name. Thus #<Safe Z> and #<safez> are the same parameter.

A name that starts with _ is global, for example #<_depth>. A name without _ is local. In the main program, a local name is available in the main program only. In a subroutine, it is available in that subroutine only.

CAMotics sets these global parameters, as LinuxCNC: #<_x> to #<_w> (the current position), #<_metric>, #<_imperial>, #<_feed>, #<_speed>, #<_tool>, #<_selected_tool>, #<_plane>, #<_mist>, #<_flood>, #<_incremental_distance_mode>, #<_value> and #<_value_returned>.

3.10.3 Expressions

Put an expression in square brackets: [2 * #1 + 3]. The operators are, from the highest precedence to the lowest:

PrecedenceOperators
1** (power)
2*, /, MOD
3+, -
4EQ, NE, GT, GE, LT, LE
5AND, OR, XOR

Operators with the same precedence apply from left to right. A comparison or a logical operator gives 1 for true and 0 for false. A value that is not 0 is true.

If you divide by zero (/ or MOD), CAMotics shows a warning and the result is 0.

The functions are:

FunctionResult
ABS[x]The absolute value.
ACOS[x], ASIN[x]The inverse cosine and sine, in degrees.
ATAN[y]/[x]The angle of the point x, y, in degrees.
COS[a], SIN[a], TAN[a]The cosine, sine and tangent of an angle in degrees.
EXP[x]e to the power x.
LN[x]The natural logarithm.
SQRT[x]The square root.
FIX[x]Rounds down to an integer.
FUP[x]Rounds up to an integer.
ROUND[x]Rounds to the nearest integer.
EXISTS[#<name>]1 if the parameter exists, else 0.

An unknown function name causes an error.

3.11 O-word subroutines and loops

An O-word controls the flow of the program. It has a number or a name, a keyword, and sometimes an expression. For example: o100 if [#1 GT 0] or o<pocket> call [5]. The number or the name connects the lines of one structure. A name can have only letters and _.

An O-word block can have only the O-word and a comment. CAMotics ignores other words in the block, and shows a warning.

3.11.1 Subroutines

A subroutine starts with sub and ends with endsub. CAMotics does not run the lines when it reads them. call runs the subroutine, and return ends it early.

G-code
o<hole> sub
  G0 X#1 Y#2
  G1 Z-2 F200
  G0 Z2
o<hole> endsub

o<hole> call [10] [10]
o<hole> call [20] [10]

The values after call go into the local parameters #1, #2 and up to #30 of the subroutine. Do not read the other local parameters before you set them. A subroutine can call another subroutine.

To give a value back, use return with an expression, for example o100 return [#1 * 2]. After the call, #<_value> has the value and #<_value_returned> is 1.

The subroutine must be in the same file, before the call. CAMotics Online does not load subroutines from other files.

3.11.2 Conditions

G-code
o200 if [#1 GT 10]
  G0 Z10
o200 elseif [#1 GT 5]
  G0 Z5
o200 else
  G0 Z2
o200 endif

3.11.3 Loops

CAMotics has three types of loop:

  • while [expr] ... endwhile: CAMotics does the test before each pass.
  • do ... while [expr]: CAMotics does the test after each pass. Thus the loop runs one time or more.
  • repeat [n] ... endrepeat: CAMotics does the loop n times.

break stops the loop. continue goes to the next pass. Use the number of the loop with each keyword.

G-code
#1 = 0
o300 while [#1 LT 5]
  G1 X[#1 * 10] F600
  #1 = [#1 + 1]
o300 endwhile

o310 repeat [3]
  G91 G1 Z-1
o310 endrepeat
G90

The online simulator counts each pass of a loop. For the limit, refer to Limits of the online simulator.

3.11.4 Example: parameters and a loop

This program cuts five slots. Named parameters set the size, and two O-word loops make the slots and the depth steps.

params.nc
(Slots with named parameters and an O-word loop, metric)
#<count> = 5
#<pitch> = 8
#<length> = 30
#<depth> = 2
#<step> = 0.5
#<safe> = 5

G21 G90 G17 G94
T1 M6
S10000 M3
G0 Z#<safe>

#<i> = 0
o100 while [#<i> LT #<count>]
  #<y> = [10 + #<i> * #<pitch>]
  G0 X10 Y#<y>
  G0 Z1
  G1 Z0 F300
  #<z> = 0
  o110 while [#<z> GT -#<depth>]
    #<z> = [#<z> - #<step>]
    G1 X[10 + #<length>] Z#<z> F600
    G1 X10
  o110 endwhile
  G0 Z#<safe>
  #<i> = [#<i> + 1]
o100 endwhile

M5
G0 X0 Y0
M2

3.12 Program end

M2 and M30 end the program. CAMotics does not read the lines after M2 or M30 in that file. If the project has more files, CAMotics continues with the next file.

At the end, CAMotics sets these modes, as LinuxCNC: G54, G17, G90, G94, G40, G1, M5 and M9. It does not change the units.

A program without M2 or M30 also ends at the end of the file.

3.13 Codes that CAMotics reads but does not run

CAMotics reads these codes without an error, but it does not do their function. For each code, it shows a warning.

CodesWhat CAMotics does
G5, G5.1, G5.2, G5.3Ignores the code. The tool does not move.
G33, G33.1Makes a G1 move to the end point.
G41, G41.1, G42, G42.1Records the mode, but does not offset the toolpath.
G73, G83, G84, G87, G88Drills one time as G81. The cycle does not stay active.
G76Ignores the code.
M48, M49, M50, M51, M52, M53Ignores the code.
M61Ignores the code.
M67, M68Ignores the code.
M100 to M199Ignores the code.

These codes have no effect on the simulation, because the simulator has no hardware for them:

CodesWhat CAMotics does
G7, G8Records the mode. X values do not change.
G38.2 to G38.9Moves to the end point. Shows a warning and sets the probe result to 0.
G61, G61.1, G64Changes only the time estimate.
G93, G95Records the mode. The time estimate uses F as units per minute.
G96, G97Records the spindle mode.
M0, M1, M60Does not stop.
M7, M7.1, M8, M8.1, M9Records the coolant state.
M62 to M65Records the output state.
M66Shows a warning and sets #5399 to 0.

CAMotics shows the warning "Invalid or unsupported code" for a G or M code that is not in its code table, for example G74, G12, M19, M98 or G10 L0. It ignores the code.

3.14 Reference

The reference has one entry for each code in the CAMotics code table. "Type / unit" uses these terms:

  • length: millimeters with G21, inches with G20.
  • number: a number with no unit.
  • integer: a whole number.

3.14.1 F: Feed rate

Sets the feed rate of G1, G2, G3 and the canned cycles.

WordType / unitDefaultDescription
Flength per minute0The feed rate.

With G93 or G95, the meaning of F changes. Refer to Feed rate and spindle speed. If the feed rate is 0 at a feed move, CAMotics uses 10 mm/min and shows a warning.

G-code
G1 X50 F600

3.14.2 S: Spindle speed

Sets the spindle speed.

WordType / unitDefaultDescription
Srevolutions per minute0The spindle speed.

With G96, S is the surface speed. The spindle turns only after M3 or M4.

G-code
S12000 M3

3.14.3 T: Select tool

Selects the next tool. M6 changes to this tool.

WordType / unitDefaultDescription
TintegernoneThe tool number in the tool table.

T alone does not change the tool. Refer to Tool changes.

G-code
T3 M6

3.14.4 G0: Rapid move

Moves the tool in a straight line at the rapid rate.

WordType / unitDefaultDescription
X, Y, Zlengthcurrent positionThe end position.
A, B, Cdegreescurrent positionThe end position of the rotary axes.
U, V, Wlengthcurrent positionThe end position of the secondary linear axes.

G0 does not use the feed rate. G0 is modal.

G-code
G0 Z5
G0 X10 Y20

3.14.5 G1: Linear move

Moves the tool in a straight line at the feed rate.

WordType / unitDefaultDescription
X, Y, Zlengthcurrent positionThe end position.
A, B, Cdegreescurrent positionThe end position of the rotary axes.
U, V, Wlengthcurrent positionThe end position of the secondary linear axes.
Flength per minutelast FThe feed rate.

G1 is modal. It is the motion mode at the start of a program.

G-code
G1 X10 Y5 F600

3.14.6 G2: Clockwise arc

Moves the tool on a clockwise arc or helix in the current plane, at the feed rate.

WordType / unitDefaultDescription
X, Y, Zlengthcurrent positionThe end position.
I, J, Klength0The center, as an offset from the start (G91.1) or a position (G90.1).
RlengthnoneThe radius. Use in place of I, J, K.
Pinteger1The number of turns.
Flength per minutelast FThe feed rate.

Refer to Arcs and helixes. If the end radius is different from the start radius, CAMotics shows a warning and continues.

G-code
G0 X10 Y0
G2 X0 Y-10 I-10 J0 F600

3.14.7 G3: Counterclockwise arc

Moves the tool on a counterclockwise arc or helix in the current plane, at the feed rate.

WordType / unitDefaultDescription
X, Y, Zlengthcurrent positionThe end position.
I, J, Klength0The center, as an offset from the start (G91.1) or a position (G90.1).
RlengthnoneThe radius. Use in place of I, J, K.
Pinteger1The number of turns.
Flength per minutelast FThe feed rate.

Refer to Arcs and helixes.

G-code
G0 X10 Y0
G3 X0 Y10 I-10 J0 F600

3.14.8 G4: Dwell

Stops the motion for a time.

WordType / unitDefaultDescription
Pseconds0The time.

The tool does not move during the dwell.

G-code
G4 P0.5

3.14.9 G5: Cubic B-spline (not supported)

In LinuxCNC, G5 makes a cubic spline move in the XY plane.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe end position.
I, JlengthnoneThe offset of the first control point from the start.
P, QlengthnoneThe offset of the second control point from the end.
G-code
G5 I0 J3 P0 Q-3 X1 Y1

3.14.10 G5.1: Quadratic B-spline (not supported)

In LinuxCNC, G5.1 makes a quadratic spline move in the XY plane.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe end position.
I, Jlength0The offset of the control point from the start.
G-code
G5.1 X4 Y0 I2 J2

3.14.11 G5.2: NURBS block start (not supported)

In LinuxCNC, G5.2 starts a block of NURBS control points.

WordType / unitDefaultDescription
X, YlengthnoneA control point.
Pnumber1The weight of the control point.
Linteger3The order of the curve.
G-code
G5.2 X0 Y1 P1 L3

3.14.12 G5.3: NURBS block end (not supported)

In LinuxCNC, G5.3 ends a NURBS block.

G-code
G5.3

3.14.13 G7: Lathe diameter mode

In LinuxCNC, G7 makes X a diameter on a lathe.

CAMotics records the mode, but X values do not change. G7 is the default mode in CAMotics. In LinuxCNC, G8 is the default.

G-code
G7

3.14.14 G8: Lathe radius mode

In LinuxCNC, G8 makes X a radius on a lathe.

CAMotics records the mode, but X values do not change.

G-code
G8

3.14.15 G10: Set tool table or coordinate system

G10 sets values in the tool table or in a coordinate system. The L word selects the function.

WordType / unitDefaultDescription
LintegernoneThe function: 1, 2, 10, 11 or 20.
PintegernoneThe tool number or the coordinate system number.

For the functions, refer to G10 L1, G10 L2, G10 L10, G10 L11 and G10 L20. If L is missing or has a different value, CAMotics shows a warning and ignores the block. CAMotics does not support G10 L0.

The tool does not move.

G-code
G10 L2 P1 X0 Y0 Z0

3.14.16 G17: XY plane

Selects the XY plane for arcs and canned cycles. The arc center words are I and J. G17 is the default.

G-code
G17

3.14.17 G17.1: UV plane

Selects the UV plane for arcs.

G-code
G17.1

3.14.18 G18: ZX plane

Selects the ZX plane for arcs and canned cycles. The arc center words are I and K.

G-code
G18 G2 X10 Z0 I5 K0

3.14.19 G18.1: WU plane

Selects the WU plane for arcs.

G-code
G18.1

3.14.20 G19: YZ plane

Selects the YZ plane for arcs and canned cycles. The arc center words are J and K.

G-code
G19

3.14.21 G19.1: VW plane

Selects the VW plane for arcs.

G-code
G19.1

3.14.22 G20: Inches

Sets the units to inches. CAMotics also changes the current position to inches.

Refer to Units.

G-code
G20

3.14.23 G21: Millimeters

Sets the units to millimeters. G21 is the default.

G-code
G21

3.14.24 G28: Go to predefined position 1

Moves the tool at the rapid rate to the position that G28.1 stored.

WordType / unitDefaultDescription
X, Y, Z, A to WlengthnoneAn intermediate point.

If the block has axis words, the tool first moves to the intermediate point. Then all axes move to the stored position. The stored position is in #5161 to #5169. At the start, it is the machine origin.

G-code
G28 Z20 (Up to Z20, then to the stored position)

3.14.25 G28.1: Set predefined position 1

Stores the current machine position for G28, in #5161 to #5169.

G-code
G28.1

3.14.26 G28.2: Set axes not homed

Marks the axes that you give as not homed. This code is from 3D printer firmware. It is not in LinuxCNC.

WordType / unitDefaultDescription
X, Y, Z, A to WanynoneThe axes to mark. The values have no effect.

CAMotics sets #<_x_homed> and the other homed parameters to 0. The tool does not move.

G-code
G28.2 X0 Y0

3.14.27 G28.3: Set home positions

Sets the machine position of the axes that you give, and marks them as homed. This code is from 3D printer firmware. It is not in LinuxCNC.

WordType / unitDefaultDescription
X, Y, Z, A to WlengthnoneThe new machine position of the axis.

CAMotics also sets the G92 offset of these axes to zero. The tool does not move.

G-code
G28.3 Z0

3.14.28 G30: Go to predefined position 2

Moves the tool at the rapid rate to the position that G30.1 stored.

WordType / unitDefaultDescription
X, Y, Z, A to WlengthnoneAn intermediate point.

G30 operates as G28. The stored position is in #5181 to #5189.

G-code
G30

3.14.29 G30.1: Set predefined position 2

Stores the current machine position for G30, in #5181 to #5189.

G-code
G30.1

3.14.30 G33: Spindle-synchronized motion (not supported)

In LinuxCNC, G33 moves the tool in synchronization with the spindle, for example to cut a thread.

WordType / unitDefaultDescription
X, Y, Zlengthcurrent positionThe end position.
Klength per revolutionnoneThe distance for each spindle turn.
G-code
G33 Z-10 K1.5

3.14.31 G33.1: Rigid tapping (not supported)

In LinuxCNC, G33.1 taps a hole with spindle synchronization, then retracts.

WordType / unitDefaultDescription
X, Y, Zlengthcurrent positionThe bottom of the hole.
Klength per revolutionnoneThe thread pitch.
G-code
G33.1 Z-10 K1.25

3.14.32 G38.2: Probe toward the workpiece, with error

In LinuxCNC, G38.2 moves the probe toward the workpiece until it touches. If the probe does not touch, it is an error.

WordType / unitDefaultDescription
X, Y, Z, A to Wlengthcurrent positionThe end position.
Flength per minutelast FThe feed rate.
G-code
G38.2 Z-20 F100

3.14.33 G38.3: Probe toward the workpiece, no error

As G38.2, but in LinuxCNC no contact is not an error.

G-code
G38.3 Z-20 F100

3.14.34 G38.4: Probe away from the workpiece, with error

In LinuxCNC, G38.4 moves the probe away from the workpiece until the contact stops.

G-code
G38.4 Z5 F100

3.14.35 G38.5: Probe away from the workpiece, no error

As G38.4, but in LinuxCNC no change of contact is not an error.

G-code
G38.5 Z5 F100

3.14.36 G38.6: Seek an active switch, with error

Moves one axis until a switch becomes active. This code is in CAMotics, not in LinuxCNC.

WordType / unitDefaultDescription
one axis wordlengthnoneThe end position. The direction selects the minimum or maximum switch.
PintegernoneThe input port. Use in place of the axis to select the switch.
G-code
G38.6 Z50

3.14.37 G38.7: Seek an active switch, no error

As G38.6, with no error if the switch does not become active.

G-code
G38.7 Z50

3.14.38 G38.8: Seek an inactive switch, with error

As G38.6, but the axis moves until the switch becomes inactive.

G-code
G38.8 Z-5

3.14.39 G38.9: Seek an inactive switch, no error

As G38.8, with no error if the switch does not become inactive.

G-code
G38.9 Z-5

3.14.40 G40: Cutter radius compensation off

Stops cutter radius compensation. G40 is the default.

G-code
G40

3.14.41 G41: Cutter radius compensation left (not supported)

In LinuxCNC, G41 offsets the toolpath to the left of the programmed path by the tool radius.

WordType / unitDefaultDescription
Dintegercurrent toolThe tool number that gives the radius.
G-code
G41 D1

3.14.42 G41.1: Dynamic cutter radius compensation left (not supported)

In LinuxCNC, G41.1 offsets the toolpath to the left by the diameter that you give.

WordType / unitDefaultDescription
DlengthnoneThe tool diameter.
Linteger0The lathe tool orientation.
G-code
G41.1 D3

3.14.43 G42: Cutter radius compensation right (not supported)

In LinuxCNC, G42 offsets the toolpath to the right of the programmed path by the tool radius.

WordType / unitDefaultDescription
Dintegercurrent toolThe tool number that gives the radius.
G-code
G42 D1

3.14.44 G42.1: Dynamic cutter radius compensation right (not supported)

In LinuxCNC, G42.1 offsets the toolpath to the right by the diameter that you give.

WordType / unitDefaultDescription
DlengthnoneThe tool diameter.
Linteger0The lathe tool orientation.
G-code
G42.1 D3

3.14.45 G43: Tool length offset

Applies the tool offsets of a tool from the tool table.

WordType / unitDefaultDescription
Hintegercurrent toolThe tool number.

The tool table of the project has no offsets. Use G10 L1 to set them. Refer to Tool length offset.

G-code
T1 M6
G43 H1

3.14.46 G43.1: Dynamic tool length offset

Applies tool offsets that you give with axis words.

WordType / unitDefaultDescription
X, Y, Z, A to WlengthunchangedThe offset of the axis.
G-code
G43.1 Z12.5

3.14.47 G43.2: Additional tool length offset

Adds the offsets of tool H to the current tool offsets.

WordType / unitDefaultDescription
HintegernoneThe tool number.
G-code
G43.2 H2

3.14.48 G49: Cancel tool length offset

Cancels the tool length offset. G49 is the default.

G-code
G49

3.14.49 G52: Local coordinate offset

Sets the G92 offset directly to the values that you give, and turns it on.

WordType / unitDefaultDescription
X, Y, Z, A to WlengthunchangedThe offset of the axis.

The tool does not move. G92.1 cancels the offset. Refer to G92 and G52 offsets.

G-code
G52 X10 Y10

3.14.50 G53: Move in machine coordinates

Makes the G0 or G1 move in the same block in machine coordinates.

G53 applies only to its block. If the block does not have G0 or G1, CAMotics shows a warning. Also, G53 is in the non-modal group, so G53 alone with axis words does not move the tool.

G-code
G53 G0 Z0

3.14.51 G54: Coordinate system 1

Selects coordinate system 1. G54 is the default. Refer to Coordinate systems.

G-code
G54

3.14.52 G55: Coordinate system 2

Selects coordinate system 2.

G-code
G55

3.14.53 G56: Coordinate system 3

Selects coordinate system 3.

G-code
G56

3.14.54 G57: Coordinate system 4

Selects coordinate system 4.

G-code
G57

3.14.55 G58: Coordinate system 5

Selects coordinate system 5.

G-code
G58

3.14.56 G59: Coordinate system 6

Selects coordinate system 6.

G-code
G59

3.14.57 G59.1: Coordinate system 7

Selects coordinate system 7.

G-code
G59.1

3.14.58 G59.2: Coordinate system 8

Selects coordinate system 8.

G-code
G59.2

3.14.59 G59.3: Coordinate system 9

Selects coordinate system 9.

G-code
G59.3

3.14.60 G61: Exact path mode

Sets exact path mode. The machine follows the programmed path exactly.

CAMotics uses the path mode only for the time estimate. The toolpath does not change.

G-code
G61

3.14.61 G61.1: Exact stop mode

Sets exact stop mode. The machine stops at the end of each move.

CAMotics uses the path mode only for the time estimate.

G-code
G61.1

3.14.62 G64: Path blending

Sets path blending mode. The machine can go away from the path by a tolerance to keep the speed. G64 is the default.

WordType / unitDefaultDescription
Plengthno limitThe blending tolerance.
Qlengththe value of PThe tolerance to merge short moves.

CAMotics uses the path mode only for the time estimate. The toolpath does not change.

G-code
G64 P0.05

3.14.63 G70: Inches, Mach3

Sets the units to inches, as G20. This is the code of Mach3 and Mach4. Use G20.

G-code
G70

3.14.64 G71: Millimeters, Mach3

Sets the units to millimeters, as G21. This is the code of Mach3 and Mach4. Use G21.

G-code
G71

3.14.65 G73: Drill with chip break (not supported)

In LinuxCNC, G73 drills in steps of Q with a small retract after each step.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe hole position.
Zlengthlast ZThe bottom of the hole.
Rlengthlast RThe retract plane.
QlengthnoneThe depth of each step.
Linteger1The number of repeats.
G-code
G73 X10 Y10 Z-10 R2 Q2 F200

3.14.66 G76: Thread cycle (not supported)

In LinuxCNC, G76 cuts a thread on a lathe in many passes.

WordType / unitDefaultDescription
PlengthnoneThe thread pitch.
ZlengthnoneThe end of the thread.
I, J, KlengthnoneThe peak offset, the first cut depth and the thread depth.
Q, H, E, L, RnumbernoneCompound angle, spring passes, taper distance, taper ends and depth degression.
G-code
G76 P1.5 Z-20 I-0.5 J0.2 K1

3.14.67 G80: Cancel canned cycle

Cancels the active canned cycle.

After G80, a block with only axis words does not move the tool. Put G0 or G1 in the next move.

G-code
G80
G0 Z10

3.14.68 G81: Drill cycle

Drills a hole: rapid to R, feed to Z, rapid to the retract plane.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe hole position.
Zlengthlast ZThe bottom of the hole.
Rlengthlast RThe retract plane, an absolute Z position.
Linteger1The number of repeats.
Flength per minutelast FThe feed rate.

Refer to Canned cycles.

G-code
G99 G81 X10 Y10 Z-5 R2 F200
X20
G80

3.14.69 G82: Drill cycle with dwell

As G81, with a dwell at the bottom of the hole.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe hole position.
Zlengthlast ZThe bottom of the hole.
Rlengthlast RThe retract plane.
Psecondslast PThe dwell.
Linteger1The number of repeats.
G-code
G82 X10 Y10 Z-3 R2 P0.5 F200

3.14.70 G83: Peck drill (not supported)

In LinuxCNC, G83 drills in steps of Q, and retracts to R after each step.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe hole position.
Zlengthlast ZThe bottom of the hole.
Rlengthlast RThe retract plane.
QlengthnoneThe depth of each peck.
Linteger1The number of repeats.
G-code
G83 X10 Y10 Z-12 R2 Q3 F200

3.14.71 G84: Right-hand tap (not supported)

In LinuxCNC, G84 taps a hole: feed in, reverse the spindle, feed out.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe hole position.
Zlengthlast ZThe bottom of the hole.
Rlengthlast RThe retract plane.
G-code
G84 X10 Y10 Z-8 R2 F300

3.14.72 G85: Bore, feed out

Bores a hole: rapid to R, feed to Z, feed back to the retract plane.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe hole position.
Zlengthlast ZThe bottom of the hole.
Rlengthlast RThe retract plane.
Linteger1The number of repeats.
G-code
G85 X10 Y10 Z-8 R2 F150

3.14.73 G86: Bore, spindle stop, rapid out

Bores a hole, stops the spindle at the bottom, retracts at the rapid rate and starts the spindle again.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe hole position.
Zlengthlast ZThe bottom of the hole.
Rlengthlast RThe retract plane.
Psecondslast PThe dwell in LinuxCNC.
Linteger1The number of repeats.
G-code
G86 X10 Y10 Z-8 R2 F150

3.14.74 G87: Back bore (not supported)

In LinuxCNC, G87 bores from the back of the workpiece.

G-code
G87 X10 Y10 Z-8 R2

3.14.75 G88: Bore, manual out (not supported)

In LinuxCNC, G88 bores, stops the spindle and waits for a manual retract.

G-code
G88 X10 Y10 Z-8 R2

3.14.76 G89: Bore, dwell, feed out

Bores a hole, dwells at the bottom, then feeds back to the retract plane.

WordType / unitDefaultDescription
X, Ylengthcurrent positionThe hole position.
Zlengthlast ZThe bottom of the hole.
Rlengthlast RThe retract plane.
Psecondslast PThe dwell.
Linteger1The number of repeats.
G-code
G89 X10 Y10 Z-8 R2 P0.5 F150

3.14.77 G90: Absolute distance mode

Axis words are positions in the current coordinate system. G90 is the default.

G-code
G90 G0 X10 Y10

3.14.78 G90.1: Absolute arc distance mode

I, J and K are the position of the arc center in the current coordinate system.

G-code
G90.1 G2 X20 Y0 I10 J0

3.14.79 G91: Incremental distance mode

Axis words are distances from the current position.

G-code
G91 G1 X5 F600 (Moves 5 mm in +X)
G90

3.14.80 G91.1: Incremental arc distance mode

I, J and K are offsets from the start point of the arc to the center. G91.1 is the default.

G-code
G91.1

3.14.81 G92: Set the current position

Sets the G92 offset so that the current position gets the values that you give. The tool does not move.

WordType / unitDefaultDescription
X, Y, Z, A to WlengthunchangedThe new current position of the axis.

The offset applies to all coordinate systems. It is in #5211 to #5219. Refer to G92 and G52 offsets.

G-code
G92 X0 Y0

3.14.82 G92.1: Cancel G92 offsets

Turns off the G92 offset and sets #5211 to #5219 to zero.

G-code
G92.1

3.14.83 G92.2: Suspend G92 offsets

Turns off the G92 offset, but keeps the values in #5211 to #5219.

G-code
G92.2

3.14.84 G92.3: Restore G92 offsets

Turns on the G92 offset again, with the values in #5211 to #5219.

G-code
G92.3

3.14.85 G93: Inverse time feed mode

In LinuxCNC, F is 1 divided by the time of the move in minutes.

G-code
G93 G1 X10 F2

3.14.86 G94: Units per minute feed mode

F is in units per minute. G94 is the default.

G-code
G94 F600

3.14.87 G95: Units per revolution feed mode

In LinuxCNC, F is the distance for each spindle turn.

G-code
G95 F0.1

3.14.88 G96: Constant surface speed

Sets constant surface speed mode for the spindle.

WordType / unitDefaultDescription
Sm/min or ft/minlast SThe surface speed.
Drevolutions per minute0The maximum spindle speed.

CAMotics records the spindle mode. The simulated cut does not change. G96 is in the non-modal group.

G-code
G96 D2500 S200

3.14.89 G97: RPM mode

Sets RPM mode for the spindle. S is in revolutions per minute. G97 is the default.

G-code
G97 S10000

3.14.90 G98: Retract to the start Z

After each canned cycle hole, the tool retracts to the Z position from before the hole, or to R if R is higher.

G-code
G98 G81 X10 Y10 Z-5 R2 F200

3.14.91 G99: Retract to R

After each canned cycle hole, the tool retracts to R. G99 is the default in CAMotics.

G-code
G99 G81 X10 Y10 Z-5 R2 F200

3.14.92 G10 L1: Set tool table

Sets the offsets and the values of a tool in the tool table.

WordType / unitDefaultDescription
PintegernoneThe tool number.
X, Y, Z, A to WlengthunchangedThe tool offset of the axis.
RlengthunchangedThe tool radius.
I, JdegreesunchangedThe front and back angles of a lathe tool.
QintegerunchangedThe lathe tool orientation.

G10 L1 changes only the values that G43 uses. It does not change the tool shape in the simulation. If the tool is not in the tool table, CAMotics adds it and shows a warning.

G-code
G10 L1 P1 Z12.5
G43 H1

3.14.93 G10 L2: Set coordinate system

Sets the origin of a coordinate system.

WordType / unitDefaultDescription
Pintegercurrent systemThe coordinate system, 1 to 9. 0 is the current system.
X, Y, Z, A to WlengthunchangedThe offset of the origin from the machine origin.
RdegreesunchangedThe rotation around the Z axis.

A P value more than 9 causes an error. The tool does not move.

G-code
G10 L2 P2 X100 Y50 Z0

3.14.94 G10 L10: Set tool table from the current position

Sets a tool offset so that, after G43, the current position has the values that you give.

WordType / unitDefaultDescription
PintegernoneThe tool number.
X, ZlengthunchangedThe position that the current point gets.
RlengthunchangedThe tool radius.
QintegerunchangedThe lathe tool orientation.
G-code
G10 L10 P1 Z0

3.14.95 G10 L11: Set tool table from coordinate system 9

As G10 L10, but CAMotics uses coordinate system 9 (G59.3) and ignores the G92 offset.

WordType / unitDefaultDescription
PintegernoneThe tool number.
X, ZlengthunchangedThe position that the current point gets.
RlengthunchangedThe tool radius.
QintegerunchangedThe lathe tool orientation.
G-code
G10 L11 P1 Z0

3.14.96 G10 L20: Set coordinate system from the current position

Sets the origin of a coordinate system so that the current position gets the values that you give.

WordType / unitDefaultDescription
Pintegercurrent systemThe coordinate system, 1 to 9. 0 is the current system.
X, Y, Z, A to WlengthunchangedThe position that the current point gets.

If you give R, CAMotics shows a warning and ignores it. The tool does not move.

G-code
G10 L20 P1 X0 Y0 Z0

3.14.97 M0: Program pause

In LinuxCNC, M0 pauses the program until the operator starts it again.

The simulator does not stop. It continues with the next block.

G-code
M0

3.14.98 M1: Optional pause

In LinuxCNC, M1 pauses the program if the optional stop switch is on.

The simulator does not stop.

G-code
M1

3.14.99 M2: End program

Ends the program. Refer to Program end.

G-code
M5
M2

3.14.100 M3: Spindle clockwise

Starts the spindle clockwise at the speed of S.

G-code
S12000 M3

3.14.101 M4: Spindle counterclockwise

Starts the spindle counterclockwise at the speed of S.

G-code
S8000 M4

3.14.102 M5: Spindle stop

Stops the spindle.

G-code
M5

3.14.103 M6: Tool change

Changes to the tool that T selected. Refer to Tool changes.

If no T word occurred before, CAMotics shows the error "No tool selected".

G-code
T2 M6

3.14.104 M7: Mist coolant on

Turns on the mist coolant. CAMotics records the state. The simulation does not change.

G-code
M7

3.14.105 M7.1: Mist coolant off

Turns off the mist coolant. This code is in CAMotics, not in LinuxCNC.

G-code
M7.1

3.14.106 M8: Flood coolant on

Turns on the flood coolant. CAMotics records the state. The simulation does not change.

G-code
M8

3.14.107 M8.1: Flood coolant off

Turns off the flood coolant. This code is in CAMotics, not in LinuxCNC.

G-code
M8.1

3.14.108 M9: All coolant off

Turns off the mist coolant and the flood coolant.

G-code
M9

3.14.109 M30: End program

Ends the program, as M2. In LinuxCNC, M30 also changes the pallet. CAMotics does not.

G-code
M30

3.14.110 M48: Enable overrides (not supported)

In LinuxCNC, M48 enables the feed rate override and the spindle speed override.

G-code
M48

3.14.111 M49: Disable overrides (not supported)

In LinuxCNC, M49 disables the feed rate override and the spindle speed override.

G-code
M49

3.14.112 M50: Feed override control (not supported)

In LinuxCNC, M50 P0 disables the feed rate override and M50 P1 enables it.

G-code
M50 P0

3.14.113 M51: Spindle override control (not supported)

In LinuxCNC, M51 P0 disables the spindle speed override and M51 P1 enables it.

G-code
M51 P1

3.14.114 M52: Adaptive feed control (not supported)

In LinuxCNC, M52 controls the adaptive feed input.

G-code
M52 P1

3.14.115 M53: Feed stop control (not supported)

In LinuxCNC, M53 controls the feed stop switch.

G-code
M53 P1

3.14.116 M60: Pallet change pause

In LinuxCNC, M60 changes the pallet and pauses the program.

The simulator does not stop.

G-code
M60

3.14.117 M61: Set current tool (not supported)

In LinuxCNC, M61 sets the current tool number without a tool change.

WordType / unitDefaultDescription
QintegernoneThe tool number.
G-code
M61 Q2

3.14.118 M62: Digital output on, with motion

Turns on a digital output at the start of the next move.

WordType / unitDefaultDescription
PintegernoneThe output number, 0 to 3.

The simulator has no outputs. For a number more than 3, CAMotics shows a warning.

G-code
M62 P0

3.14.119 M63: Digital output off, with motion

Turns off a digital output at the start of the next move.

WordType / unitDefaultDescription
PintegernoneThe output number, 0 to 3.
G-code
M63 P0

3.14.120 M64: Digital output on, immediately

Turns on a digital output immediately.

WordType / unitDefaultDescription
PintegernoneThe output number, 0 to 3.
G-code
M64 P1

3.14.121 M65: Digital output off, immediately

Turns off a digital output immediately.

WordType / unitDefaultDescription
PintegernoneThe output number, 0 to 3.
G-code
M65 P1

3.14.122 M66: Wait for input

In LinuxCNC, M66 waits for a digital or analog input and puts the result in #5399.

WordType / unitDefaultDescription
PintegernoneThe digital input number, 0 to 3.
EintegernoneThe analog input number, 0 to 3.
Linteger0The wait mode: 0 immediate, 1 rise, 2 fall, 3 high, 4 low.
Qseconds0The maximum time to wait.
G-code
M66 P0 L3 Q5

3.14.123 M67: Analog output, with motion (not supported)

In LinuxCNC, M67 sets an analog output at the start of the next move.

WordType / unitDefaultDescription
EintegernoneThe output number.
QnumbernoneThe value.
G-code
M67 E0 Q5

3.14.124 M68: Analog output, immediately (not supported)

In LinuxCNC, M68 sets an analog output immediately.

WordType / unitDefaultDescription
EintegernoneThe output number.
QnumbernoneThe value.
G-code
M68 E0 Q5

3.14.125 M70: Save modal state

Saves the modal state: units, distance modes, plane, feed rate mode, coordinate system, spindle, coolant, feed rate and path mode.

G-code
M70

3.14.126 M71: Clear the saved modal state

Clears the state that M70 or M73 saved in the current subroutine level.

G-code
M71

3.14.127 M72: Restore modal state

Restores the state that M70 or M73 saved in the current subroutine level. If there is no saved state, CAMotics shows a warning.

G-code
M72

3.14.128 M73: Save and restore modal state

Saves the modal state. At the end of the subroutine, CAMotics restores it automatically.

Use M73 in a subroutine. In the main program, CAMotics shows a warning.

G-code
o<part> sub
  M73
  G91 G20
  (The subroutine can change the modes)
o<part> endsub

3.14.129 M100 to M199: User-defined commands (not supported)

In LinuxCNC, M100 to M199 run a program that the user supplies.

WordType / unitDefaultDescription
P, QnumbernoneValues for the user program.
G-code
M101 P1 Q2