From 2a70e212ad7b2e4a7960f817dcb72b7311e006b0 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Mon, 9 Nov 2026 19:22:06 +1100 Subject: [PATCH] interp: G43.2 axis words are offsets, never a move A line with axis words and no motion code moves in the modal motion mode, except when G43.1 takes the axis words as offsets. Since G43.2 takes axis words as well (2df2871ba0), the check above lets them through for G43.2 too, but the line still became a move: after G0, "G43.2 X0 Y0" applied the offset and then went to X0 Y0. The documentation says G43.2 causes no motion. This is the first half of 0ed1bbd56c on master. The second half, which makes a motion code or another axis-word G-code on a G43.1 or G43.2 line an error, can refuse programs that run today and stays on master. tests/interp/machine-coord-params already checks that G43.1 leaves the machine position alone; it now checks G43.2 axis words under G0 and G1 as well. Reported by Sigma1912. --- src/emc/rs274ngc/interp_internal.cc | 3 ++- tests/interp/machine-coord-params/expected | 2 ++ tests/interp/machine-coord-params/test.ngc | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/emc/rs274ngc/interp_internal.cc b/src/emc/rs274ngc/interp_internal.cc index 829591161df..a3e92a77739 100644 --- a/src/emc/rs274ngc/interp_internal.cc +++ b/src/emc/rs274ngc/interp_internal.cc @@ -206,7 +206,8 @@ int Interp::enhance_block(block_pointer block, //!< pointer to a block to be c || (settings->motion_mode == G_80)) && (block->g_modes[GM_TOOL_LENGTH_OFFSET] != G_43_1) && (block->g_modes[GM_TOOL_LENGTH_OFFSET] != G_43_2), NCE_CANNOT_USE_AXIS_VALUES_WITHOUT_A_G_CODE_THAT_USES_THEM); - if (block->g_modes[GM_TOOL_LENGTH_OFFSET] != G_43_1) { + if (block->g_modes[GM_TOOL_LENGTH_OFFSET] != G_43_1 + && block->g_modes[GM_TOOL_LENGTH_OFFSET] != G_43_2) { block->motion_to_be = settings->motion_mode; } } else if (!axis_flag && !polar_flag && ijk_flag && (settings->motion_mode == G_2 || settings->motion_mode == G_3)) { diff --git a/tests/interp/machine-coord-params/expected b/tests/interp/machine-coord-params/expected index 5a2b6ce7571..9dca475c99b 100644 --- a/tests/interp/machine-coord-params/expected +++ b/tests/interp/machine-coord-params/expected @@ -9,5 +9,7 @@ N..... MESSAGE("0.000000 0.000000 0.000000") N..... MESSAGE("1.000000 2.000000 3.000000") N..... MESSAGE("1.000000 2.000000 3.000000") + N..... MESSAGE("1.000000 2.000000 3.000000") + N..... MESSAGE("1.000000 2.000000 3.000000") N..... MESSAGE("1.000000 1.000000") N..... MESSAGE("3.000000 3.000000") diff --git a/tests/interp/machine-coord-params/test.ngc b/tests/interp/machine-coord-params/test.ngc index 43eb52af286..a5759a1ee8c 100644 --- a/tests/interp/machine-coord-params/test.ngc +++ b/tests/interp/machine-coord-params/test.ngc @@ -40,6 +40,14 @@ g53 g0 x1 y2 z3 (debug,#5021 #5022 #5023) g49 +; nor do G43.2 axis words move it, in G0 or in G1 mode +g43.2 x0 y0 +(debug,#5021 #5022 #5023) +g1 f100 x1 +g43.2 z2 +(debug,#5021 #5022 #5023) +g49 + ; numbered set agrees with the named set g53 g0 x1 y2 z3 (debug,#5021 #<_abs_x>)