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
Nand an integer, after the/. - Words. A word is a letter and a value, for example
G1,X10.5orF600. - 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.
/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:
- Parameter assignments, from left to right.
- The special comment, such as
(MSG,...). - G7, G8, G96 and G97.
- The feed rate F.
- The spindle speed S.
- The tool selection T.
- M62 to M68 (outputs and inputs).
- M6 and M61 (tool change).
- M3, M4 and M5 (spindle).
- M70 to M73 (modal state).
- M7, M8, M9, M7.1 and M8.1 (coolant).
- M48 to M53 (overrides).
- M100 to M199.
- G4 (dwell).
- G17 to G19.1 (plane).
- G20, G21, G70 and G71 (units).
- G40 to G42.1 (cutter radius compensation).
- G43 to G49 (tool length offset).
- G54 to G59.3 (coordinate system).
- G61, G61.1 and G64 (path mode).
- G90, G90.1, G91 and G91.1 (distance mode).
- G98 and G99 (canned cycle retract).
- G10, G28 to G30.1, G52, G53, G92 to G92.3 and G93 to G95.
- The motion: G0 to G5.3, G33, G38.x, G73, G76 and G80 to G89.
- 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:
| Mode | Default |
|---|---|
| Motion mode | G1 |
| Plane | G17 (XY) |
| Units | G21 (millimeters) |
| Distance mode | G90 (absolute) |
| Arc center distance mode | G91.1 (incremental) |
| Feed rate mode | G94 (units per minute) |
| Cutter radius compensation | G40 (off) |
| Tool length offset | G49 (off) |
| Coordinate system | G54 |
| Canned cycle retract | G99 (to R) |
| Spindle | M5 (off), G97 (RPM) |
| Coolant | M9 (off) |
| Feed rate and spindle speed | 0 |
3.2 Modal groups
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.
| Group | Codes |
|---|---|
| Motion | G0, G1, G2, G3, G5, G5.1, G5.2, G5.3, G33, G33.1, G38.2 to G38.9, G73, G76, G80 to G89 |
| Plane | G17, G17.1, G18, G18.1, G19, G19.1 |
| Lathe diameter | G7, G8 |
| Distance | G90, G91 |
| Arc distance | G90.1, G91.1 |
| Feed rate mode | G93, G94, G95 |
| Units | G20, G21, G70, G71 |
| Cutter radius compensation | G40, G41, G41.1, G42, G42.1 |
| Tool length offset | G43, G43.1, G43.2, G49 |
| Canned cycle return | G98, G99 |
| Coordinate system | G54, G55, G56, G57, G58, G59, G59.1, G59.2, G59.3 |
| Stop | M0, M1, M2, M30, M60 |
| Tool change | M6, M61 |
| Spindle | M3, M4, M5 |
| Coolant | M7, M7.1, M8, M8.1, M9 |
| Override | M48, M49, M50, M51, M52, M53 |
| Non-modal | G4, 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:
- The offset of the current coordinate system, G54 to G59.3.
- The tool length offset, G43.
- 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.
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.
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.
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.
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.
(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
M23.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:
| Word | Description |
|---|---|
X, Y | The position of the hole. |
Z | The bottom of the hole. |
R | The retract plane. The tool goes down to R at the rapid rate. |
L | The number of times to do the cycle. The default is 1. |
P | The dwell at the bottom, in seconds (G82, G86, G89). |
F | The 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 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
M23.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.
| Comment | What 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. |
#<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.
#1 = 10
G1 X#1 Y[#1 / 2] F600Some numbered parameters have a special function, as in LinuxCNC:
| Parameters | Contents |
|---|---|
| #5061 to #5069 | The probe result position. |
| #5070 | 1 if the probe found contact, else 0. |
| #5161 to #5169 | The G28 position. |
| #5181 to #5189 | The G30 position. |
| #5210 | 1 if the G92 offset is on. |
| #5211 to #5219 | The G92 offset. |
| #5220 | The current coordinate system, 1 to 9. |
| #5221 to #5230 | The offsets and the rotation of coordinate system 1. Systems 2 to 9 follow in steps of 20. |
| #5399 | The result of M66. |
| #5400 | The current tool number. |
| #5401 to #5409 | The tool offsets. |
| #5420 to #5428 | The 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:
| Precedence | Operators |
|---|---|
| 1 | ** (power) |
| 2 | *, /, MOD |
| 3 | +, - |
| 4 | EQ, NE, GT, GE, LT, LE |
| 5 | AND, 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:
| Function | Result |
|---|---|
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.
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
o200 if [#1 GT 10]
G0 Z10
o200 elseif [#1 GT 5]
G0 Z5
o200 else
G0 Z2
o200 endif3.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.
#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
G90The 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.
(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
M23.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.
| Codes | What CAMotics does |
|---|---|
| G5, G5.1, G5.2, G5.3 | Ignores the code. The tool does not move. |
| G33, G33.1 | Makes a G1 move to the end point. |
| G41, G41.1, G42, G42.1 | Records the mode, but does not offset the toolpath. |
| G73, G83, G84, G87, G88 | Drills one time as G81. The cycle does not stay active. |
| G76 | Ignores the code. |
| M48, M49, M50, M51, M52, M53 | Ignores the code. |
| M61 | Ignores the code. |
| M67, M68 | Ignores the code. |
| M100 to M199 | Ignores the code. |
These codes have no effect on the simulation, because the simulator has no hardware for them:
| Codes | What CAMotics does |
|---|---|
| G7, G8 | Records the mode. X values do not change. |
| G38.2 to G38.9 | Moves to the end point. Shows a warning and sets the probe result to 0. |
| G61, G61.1, G64 | Changes only the time estimate. |
| G93, G95 | Records the mode. The time estimate uses F as units per minute. |
| G96, G97 | Records the spindle mode. |
| M0, M1, M60 | Does not stop. |
| M7, M7.1, M8, M8.1, M9 | Records the coolant state. |
| M62 to M65 | Records the output state. |
| M66 | Shows 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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
F | length per minute | 0 | The 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.
G1 X50 F6003.14.2 S: Spindle speed
Sets the spindle speed.
| Word | Type / unit | Default | Description |
|---|---|---|---|
S | revolutions per minute | 0 | The spindle speed. |
With G96, S is the surface speed. The spindle turns only after M3 or M4.
S12000 M33.14.3 T: Select tool
Selects the next tool. M6 changes to this tool.
| Word | Type / unit | Default | Description |
|---|---|---|---|
T | integer | none | The tool number in the tool table. |
T alone does not change the tool. Refer to Tool changes.
T3 M63.14.4 G0: Rapid move
Moves the tool in a straight line at the rapid rate.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z | length | current position | The end position. |
A, B, C | degrees | current position | The end position of the rotary axes. |
U, V, W | length | current position | The end position of the secondary linear axes. |
G0 does not use the feed rate. G0 is modal.
G0 Z5
G0 X10 Y203.14.5 G1: Linear move
Moves the tool in a straight line at the feed rate.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z | length | current position | The end position. |
A, B, C | degrees | current position | The end position of the rotary axes. |
U, V, W | length | current position | The end position of the secondary linear axes. |
F | length per minute | last F | The feed rate. |
G1 is modal. It is the motion mode at the start of a program.
G1 X10 Y5 F6003.14.6 G2: Clockwise arc
Moves the tool on a clockwise arc or helix in the current plane, at the feed rate.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z | length | current position | The end position. |
I, J, K | length | 0 | The center, as an offset from the start (G91.1) or a position (G90.1). |
R | length | none | The radius. Use in place of I, J, K. |
P | integer | 1 | The number of turns. |
F | length per minute | last F | The feed rate. |
Refer to Arcs and helixes. If the end radius is different from the start radius, CAMotics shows a warning and continues.
G0 X10 Y0
G2 X0 Y-10 I-10 J0 F6003.14.7 G3: Counterclockwise arc
Moves the tool on a counterclockwise arc or helix in the current plane, at the feed rate.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z | length | current position | The end position. |
I, J, K | length | 0 | The center, as an offset from the start (G91.1) or a position (G90.1). |
R | length | none | The radius. Use in place of I, J, K. |
P | integer | 1 | The number of turns. |
F | length per minute | last F | The feed rate. |
Refer to Arcs and helixes.
G0 X10 Y0
G3 X0 Y10 I-10 J0 F6003.14.8 G4: Dwell
Stops the motion for a time.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | seconds | 0 | The time. |
The tool does not move during the dwell.
G4 P0.53.14.9 G5: Cubic B-spline (not supported)
In LinuxCNC, G5 makes a cubic spline move in the XY plane.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The end position. |
I, J | length | none | The offset of the first control point from the start. |
P, Q | length | none | The offset of the second control point from the end. |
G5 I0 J3 P0 Q-3 X1 Y13.14.10 G5.1: Quadratic B-spline (not supported)
In LinuxCNC, G5.1 makes a quadratic spline move in the XY plane.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The end position. |
I, J | length | 0 | The offset of the control point from the start. |
G5.1 X4 Y0 I2 J23.14.11 G5.2: NURBS block start (not supported)
In LinuxCNC, G5.2 starts a block of NURBS control points.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | none | A control point. |
P | number | 1 | The weight of the control point. |
L | integer | 3 | The order of the curve. |
G5.2 X0 Y1 P1 L33.14.12 G5.3: NURBS block end (not supported)
In LinuxCNC, G5.3 ends a NURBS block.
G5.33.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.
G73.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.
G83.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
L | integer | none | The function: 1, 2, 10, 11 or 20. |
P | integer | none | The 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.
G10 L2 P1 X0 Y0 Z03.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.
G173.14.17 G17.1: UV plane
Selects the UV plane for arcs.
G17.13.14.18 G18: ZX plane
Selects the ZX plane for arcs and canned cycles. The arc center words are I and K.
G18 G2 X10 Z0 I5 K03.14.19 G18.1: WU plane
Selects the WU plane for arcs.
G18.13.14.20 G19: YZ plane
Selects the YZ plane for arcs and canned cycles. The arc center words are J and K.
G193.14.21 G19.1: VW plane
Selects the VW plane for arcs.
G19.13.14.22 G20: Inches
Sets the units to inches. CAMotics also changes the current position to inches.
Refer to Units.
G203.14.23 G21: Millimeters
Sets the units to millimeters. G21 is the default.
G213.14.24 G28: Go to predefined position 1
Moves the tool at the rapid rate to the position that G28.1 stored.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z, A to W | length | none | An 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.
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.
G28.13.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z, A to W | any | none | The axes to mark. The values have no effect. |
CAMotics sets #<_x_homed> and the other homed parameters to 0. The tool does not move.
G28.2 X0 Y03.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z, A to W | length | none | The new machine position of the axis. |
CAMotics also sets the G92 offset of these axes to zero. The tool does not move.
G28.3 Z03.14.28 G30: Go to predefined position 2
Moves the tool at the rapid rate to the position that G30.1 stored.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z, A to W | length | none | An intermediate point. |
G30 operates as G28. The stored position is in #5181 to #5189.
G303.14.29 G30.1: Set predefined position 2
Stores the current machine position for G30, in #5181 to #5189.
G30.13.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z | length | current position | The end position. |
K | length per revolution | none | The distance for each spindle turn. |
G33 Z-10 K1.53.14.31 G33.1: Rigid tapping (not supported)
In LinuxCNC, G33.1 taps a hole with spindle synchronization, then retracts.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z | length | current position | The bottom of the hole. |
K | length per revolution | none | The thread pitch. |
G33.1 Z-10 K1.253.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z, A to W | length | current position | The end position. |
F | length per minute | last F | The feed rate. |
G38.2 Z-20 F1003.14.33 G38.3: Probe toward the workpiece, no error
As G38.2, but in LinuxCNC no contact is not an error.
G38.3 Z-20 F1003.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.
G38.4 Z5 F1003.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.
G38.5 Z5 F1003.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
| one axis word | length | none | The end position. The direction selects the minimum or maximum switch. |
P | integer | none | The input port. Use in place of the axis to select the switch. |
G38.6 Z503.14.37 G38.7: Seek an active switch, no error
As G38.6, with no error if the switch does not become active.
G38.7 Z503.14.38 G38.8: Seek an inactive switch, with error
As G38.6, but the axis moves until the switch becomes inactive.
G38.8 Z-53.14.39 G38.9: Seek an inactive switch, no error
As G38.8, with no error if the switch does not become inactive.
G38.9 Z-53.14.40 G40: Cutter radius compensation off
Stops cutter radius compensation. G40 is the default.
G403.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
D | integer | current tool | The tool number that gives the radius. |
G41 D13.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
D | length | none | The tool diameter. |
L | integer | 0 | The lathe tool orientation. |
G41.1 D33.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
D | integer | current tool | The tool number that gives the radius. |
G42 D13.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
D | length | none | The tool diameter. |
L | integer | 0 | The lathe tool orientation. |
G42.1 D33.14.45 G43: Tool length offset
Applies the tool offsets of a tool from the tool table.
| Word | Type / unit | Default | Description |
|---|---|---|---|
H | integer | current tool | The tool number. |
The tool table of the project has no offsets. Use G10 L1 to set them. Refer to Tool length offset.
T1 M6
G43 H13.14.46 G43.1: Dynamic tool length offset
Applies tool offsets that you give with axis words.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z, A to W | length | unchanged | The offset of the axis. |
G43.1 Z12.53.14.47 G43.2: Additional tool length offset
Adds the offsets of tool H to the current tool offsets.
| Word | Type / unit | Default | Description |
|---|---|---|---|
H | integer | none | The tool number. |
G43.2 H23.14.48 G49: Cancel tool length offset
Cancels the tool length offset. G49 is the default.
G493.14.49 G52: Local coordinate offset
Sets the G92 offset directly to the values that you give, and turns it on.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z, A to W | length | unchanged | The offset of the axis. |
The tool does not move. G92.1 cancels the offset. Refer to G92 and G52 offsets.
G52 X10 Y103.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.
G53 G0 Z03.14.51 G54: Coordinate system 1
Selects coordinate system 1. G54 is the default. Refer to Coordinate systems.
G543.14.52 G55: Coordinate system 2
Selects coordinate system 2.
G553.14.53 G56: Coordinate system 3
Selects coordinate system 3.
G563.14.54 G57: Coordinate system 4
Selects coordinate system 4.
G573.14.55 G58: Coordinate system 5
Selects coordinate system 5.
G583.14.56 G59: Coordinate system 6
Selects coordinate system 6.
G593.14.57 G59.1: Coordinate system 7
Selects coordinate system 7.
G59.13.14.58 G59.2: Coordinate system 8
Selects coordinate system 8.
G59.23.14.59 G59.3: Coordinate system 9
Selects coordinate system 9.
G59.33.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.
G613.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.
G61.13.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | length | no limit | The blending tolerance. |
Q | length | the value of P | The tolerance to merge short moves. |
CAMotics uses the path mode only for the time estimate. The toolpath does not change.
G64 P0.053.14.63 G70: Inches, Mach3
Sets the units to inches, as G20. This is the code of Mach3 and Mach4. Use G20.
G703.14.64 G71: Millimeters, Mach3
Sets the units to millimeters, as G21. This is the code of Mach3 and Mach4. Use G21.
G713.14.65 G73: Drill with chip break (not supported)
In LinuxCNC, G73 drills in steps of Q with a small retract after each step.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The hole position. |
Z | length | last Z | The bottom of the hole. |
R | length | last R | The retract plane. |
Q | length | none | The depth of each step. |
L | integer | 1 | The number of repeats. |
G73 X10 Y10 Z-10 R2 Q2 F2003.14.66 G76: Thread cycle (not supported)
In LinuxCNC, G76 cuts a thread on a lathe in many passes.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | length | none | The thread pitch. |
Z | length | none | The end of the thread. |
I, J, K | length | none | The peak offset, the first cut depth and the thread depth. |
Q, H, E, L, R | number | none | Compound angle, spring passes, taper distance, taper ends and depth degression. |
G76 P1.5 Z-20 I-0.5 J0.2 K13.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.
G80
G0 Z103.14.68 G81: Drill cycle
Drills a hole: rapid to R, feed to Z, rapid to the retract plane.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The hole position. |
Z | length | last Z | The bottom of the hole. |
R | length | last R | The retract plane, an absolute Z position. |
L | integer | 1 | The number of repeats. |
F | length per minute | last F | The feed rate. |
Refer to Canned cycles.
G99 G81 X10 Y10 Z-5 R2 F200
X20
G803.14.69 G82: Drill cycle with dwell
As G81, with a dwell at the bottom of the hole.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The hole position. |
Z | length | last Z | The bottom of the hole. |
R | length | last R | The retract plane. |
P | seconds | last P | The dwell. |
L | integer | 1 | The number of repeats. |
G82 X10 Y10 Z-3 R2 P0.5 F2003.14.70 G83: Peck drill (not supported)
In LinuxCNC, G83 drills in steps of Q, and retracts to R after each step.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The hole position. |
Z | length | last Z | The bottom of the hole. |
R | length | last R | The retract plane. |
Q | length | none | The depth of each peck. |
L | integer | 1 | The number of repeats. |
G83 X10 Y10 Z-12 R2 Q3 F2003.14.71 G84: Right-hand tap (not supported)
In LinuxCNC, G84 taps a hole: feed in, reverse the spindle, feed out.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The hole position. |
Z | length | last Z | The bottom of the hole. |
R | length | last R | The retract plane. |
G84 X10 Y10 Z-8 R2 F3003.14.72 G85: Bore, feed out
Bores a hole: rapid to R, feed to Z, feed back to the retract plane.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The hole position. |
Z | length | last Z | The bottom of the hole. |
R | length | last R | The retract plane. |
L | integer | 1 | The number of repeats. |
G85 X10 Y10 Z-8 R2 F1503.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The hole position. |
Z | length | last Z | The bottom of the hole. |
R | length | last R | The retract plane. |
P | seconds | last P | The dwell in LinuxCNC. |
L | integer | 1 | The number of repeats. |
G86 X10 Y10 Z-8 R2 F1503.14.74 G87: Back bore (not supported)
In LinuxCNC, G87 bores from the back of the workpiece.
G87 X10 Y10 Z-8 R23.14.75 G88: Bore, manual out (not supported)
In LinuxCNC, G88 bores, stops the spindle and waits for a manual retract.
G88 X10 Y10 Z-8 R23.14.76 G89: Bore, dwell, feed out
Bores a hole, dwells at the bottom, then feeds back to the retract plane.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y | length | current position | The hole position. |
Z | length | last Z | The bottom of the hole. |
R | length | last R | The retract plane. |
P | seconds | last P | The dwell. |
L | integer | 1 | The number of repeats. |
G89 X10 Y10 Z-8 R2 P0.5 F1503.14.77 G90: Absolute distance mode
Axis words are positions in the current coordinate system. G90 is the default.
G90 G0 X10 Y103.14.78 G90.1: Absolute arc distance mode
I, J and K are the position of the arc center in the current coordinate system.
G90.1 G2 X20 Y0 I10 J03.14.79 G91: Incremental distance mode
Axis words are distances from the current position.
G91 G1 X5 F600 (Moves 5 mm in +X)
G903.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.
G91.13.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
X, Y, Z, A to W | length | unchanged | The 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.
G92 X0 Y03.14.82 G92.1: Cancel G92 offsets
Turns off the G92 offset and sets #5211 to #5219 to zero.
G92.13.14.83 G92.2: Suspend G92 offsets
Turns off the G92 offset, but keeps the values in #5211 to #5219.
G92.23.14.84 G92.3: Restore G92 offsets
Turns on the G92 offset again, with the values in #5211 to #5219.
G92.33.14.85 G93: Inverse time feed mode
In LinuxCNC, F is 1 divided by the time of the move in minutes.
G93 G1 X10 F23.14.86 G94: Units per minute feed mode
F is in units per minute. G94 is the default.
G94 F6003.14.87 G95: Units per revolution feed mode
In LinuxCNC, F is the distance for each spindle turn.
G95 F0.13.14.88 G96: Constant surface speed
Sets constant surface speed mode for the spindle.
| Word | Type / unit | Default | Description |
|---|---|---|---|
S | m/min or ft/min | last S | The surface speed. |
D | revolutions per minute | 0 | The maximum spindle speed. |
CAMotics records the spindle mode. The simulated cut does not change. G96 is in the non-modal group.
G96 D2500 S2003.14.89 G97: RPM mode
Sets RPM mode for the spindle. S is in revolutions per minute. G97 is the default.
G97 S100003.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.
G98 G81 X10 Y10 Z-5 R2 F2003.14.91 G99: Retract to R
After each canned cycle hole, the tool retracts to R. G99 is the default in CAMotics.
G99 G81 X10 Y10 Z-5 R2 F2003.14.92 G10 L1: Set tool table
Sets the offsets and the values of a tool in the tool table.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | none | The tool number. |
X, Y, Z, A to W | length | unchanged | The tool offset of the axis. |
R | length | unchanged | The tool radius. |
I, J | degrees | unchanged | The front and back angles of a lathe tool. |
Q | integer | unchanged | The 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.
G10 L1 P1 Z12.5
G43 H13.14.93 G10 L2: Set coordinate system
Sets the origin of a coordinate system.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | current system | The coordinate system, 1 to 9. 0 is the current system. |
X, Y, Z, A to W | length | unchanged | The offset of the origin from the machine origin. |
R | degrees | unchanged | The rotation around the Z axis. |
A P value more than 9 causes an error. The tool does not move.
G10 L2 P2 X100 Y50 Z03.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | none | The tool number. |
X, Z | length | unchanged | The position that the current point gets. |
R | length | unchanged | The tool radius. |
Q | integer | unchanged | The lathe tool orientation. |
G10 L10 P1 Z03.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | none | The tool number. |
X, Z | length | unchanged | The position that the current point gets. |
R | length | unchanged | The tool radius. |
Q | integer | unchanged | The lathe tool orientation. |
G10 L11 P1 Z03.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.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | current system | The coordinate system, 1 to 9. 0 is the current system. |
X, Y, Z, A to W | length | unchanged | The position that the current point gets. |
If you give R, CAMotics shows a warning and ignores it. The tool does not move.
G10 L20 P1 X0 Y0 Z03.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.
M03.14.98 M1: Optional pause
In LinuxCNC, M1 pauses the program if the optional stop switch is on.
The simulator does not stop.
M13.14.99 M2: End program
Ends the program. Refer to Program end.
M5
M23.14.100 M3: Spindle clockwise
Starts the spindle clockwise at the speed of S.
S12000 M33.14.101 M4: Spindle counterclockwise
Starts the spindle counterclockwise at the speed of S.
S8000 M43.14.102 M5: Spindle stop
Stops the spindle.
M53.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".
T2 M63.14.104 M7: Mist coolant on
Turns on the mist coolant. CAMotics records the state. The simulation does not change.
M73.14.105 M7.1: Mist coolant off
Turns off the mist coolant. This code is in CAMotics, not in LinuxCNC.
M7.13.14.106 M8: Flood coolant on
Turns on the flood coolant. CAMotics records the state. The simulation does not change.
M83.14.107 M8.1: Flood coolant off
Turns off the flood coolant. This code is in CAMotics, not in LinuxCNC.
M8.13.14.108 M9: All coolant off
Turns off the mist coolant and the flood coolant.
M93.14.109 M30: End program
Ends the program, as M2. In LinuxCNC, M30 also changes the pallet. CAMotics does not.
M303.14.110 M48: Enable overrides (not supported)
In LinuxCNC, M48 enables the feed rate override and the spindle speed override.
M483.14.111 M49: Disable overrides (not supported)
In LinuxCNC, M49 disables the feed rate override and the spindle speed override.
M493.14.112 M50: Feed override control (not supported)
In LinuxCNC, M50 P0 disables the feed rate override and M50 P1 enables it.
M50 P03.14.113 M51: Spindle override control (not supported)
In LinuxCNC, M51 P0 disables the spindle speed override and M51 P1 enables it.
M51 P13.14.114 M52: Adaptive feed control (not supported)
In LinuxCNC, M52 controls the adaptive feed input.
M52 P13.14.115 M53: Feed stop control (not supported)
In LinuxCNC, M53 controls the feed stop switch.
M53 P13.14.116 M60: Pallet change pause
In LinuxCNC, M60 changes the pallet and pauses the program.
The simulator does not stop.
M603.14.117 M61: Set current tool (not supported)
In LinuxCNC, M61 sets the current tool number without a tool change.
| Word | Type / unit | Default | Description |
|---|---|---|---|
Q | integer | none | The tool number. |
M61 Q23.14.118 M62: Digital output on, with motion
Turns on a digital output at the start of the next move.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | none | The output number, 0 to 3. |
The simulator has no outputs. For a number more than 3, CAMotics shows a warning.
M62 P03.14.119 M63: Digital output off, with motion
Turns off a digital output at the start of the next move.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | none | The output number, 0 to 3. |
M63 P03.14.120 M64: Digital output on, immediately
Turns on a digital output immediately.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | none | The output number, 0 to 3. |
M64 P13.14.121 M65: Digital output off, immediately
Turns off a digital output immediately.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | none | The output number, 0 to 3. |
M65 P13.14.122 M66: Wait for input
In LinuxCNC, M66 waits for a digital or analog input and puts the result in #5399.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P | integer | none | The digital input number, 0 to 3. |
E | integer | none | The analog input number, 0 to 3. |
L | integer | 0 | The wait mode: 0 immediate, 1 rise, 2 fall, 3 high, 4 low. |
Q | seconds | 0 | The maximum time to wait. |
M66 P0 L3 Q53.14.123 M67: Analog output, with motion (not supported)
In LinuxCNC, M67 sets an analog output at the start of the next move.
| Word | Type / unit | Default | Description |
|---|---|---|---|
E | integer | none | The output number. |
Q | number | none | The value. |
M67 E0 Q53.14.124 M68: Analog output, immediately (not supported)
In LinuxCNC, M68 sets an analog output immediately.
| Word | Type / unit | Default | Description |
|---|---|---|---|
E | integer | none | The output number. |
Q | number | none | The value. |
M68 E0 Q53.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.
M703.14.126 M71: Clear the saved modal state
Clears the state that M70 or M73 saved in the current subroutine level.
M713.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.
M723.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.
o<part> sub
M73
G91 G20
(The subroutine can change the modes)
o<part> endsub3.14.129 M100 to M199: User-defined commands (not supported)
In LinuxCNC, M100 to M199 run a program that the user supplies.
| Word | Type / unit | Default | Description |
|---|---|---|---|
P, Q | number | none | Values for the user program. |
M101 P1 Q2