From 4b2e51c12bcf470fba63e9d9070295c9f66cb9ab Mon Sep 17 00:00:00 2001 From: david mueller Date: Thu, 19 Feb 2026 16:13:25 +0100 Subject: [PATCH] Fix G43.x - G49 in active gcodes Current behavior shows 'G49' if current tool offset values are all zero and 'G43' if not. 'G43.1' and 'G43.2' are both shown as 'G43'. With this change we show 'G43', 'G43.1', 'G43.2' after the respective command 'G49' after g49 command Note that nothing is shown on startup unless it (eg 'G49') is found in RS274NGC_STARTUP_CODE. --- src/emc/rs274ngc/interp_write.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/emc/rs274ngc/interp_write.cc b/src/emc/rs274ngc/interp_write.cc index cd5d0b10d6d..af0c620216d 100644 --- a/src/emc/rs274ngc/interp_write.cc +++ b/src/emc/rs274ngc/interp_write.cc @@ -107,10 +107,11 @@ int Interp::write_g_codes(block_pointer block, //!< pointer to a block of RS27 (settings->origin_index < 7) ? (530 + (10 * settings->origin_index)) : (584 + settings->origin_index); - settings->active_g_codes[9] = - (settings->tool_offset.tran.x || settings->tool_offset.tran.y || settings->tool_offset.tran.z || - settings->tool_offset.a || settings->tool_offset.b || settings->tool_offset.c || - settings->tool_offset.u || settings->tool_offset.v || settings->tool_offset.w) ? G_43 : G_49; + if (block != NULL){ + if (block->g_modes[gees[G_43]] > 0){ + settings->active_g_codes[9] = block->g_modes[gees[G_43]]; + } + } settings->active_g_codes[10] = (settings->retract_mode == RETRACT_MODE::OLD_Z) ? G_98 : G_99; // Three modes: G_64, G_61, G_61_1 or CANON_CONTINUOUS/EXACT_PATH/EXACT_STOP settings->active_g_codes[11] =