Browse Learn topics

Learn/GcodePilot/Automation & safety

G-code Engine (RS274NGC)

Updated v2.6.0

At a glance

  • Full RS274NGC interpreter: variables, expressions, flow control, and subroutines — LinuxCNC-style
  • Reactive programs run live: G38 probing, M66 wait-on-input, and MSG operator dialogs resolve against the real machine
  • Probe and input-wait results stay paired with their own command, even when result and acknowledgement arrive in either order
  • M0/M1 pauses with the pendant and HUD aware of the hold
  • Pinned subroutine controls show saved, saving, pending, or failed persistence without losing the active local value
  • The same engine powers touch-off routines, tool-change subs, and runtime-hook conditions

GcodePilot runs programs through a full RS274NGC interpreter — the LinuxCNC dialect: # variables, expressions, if/while flow control, o<name> subroutines, and system parameters.

Reactive programs against a live machine

Plain programs expand and stream. Programs that need answers from the machine — a G38 probe result, an M66 wait-on-input, an operator (MSG, …) dialog, an M0/M1 pause — run through the live runner, which streams motion and drains at each of those points to resolve them against the real controller before continuing. That's what makes conditional plasma touch-off routines and tool-change subroutines possible on firmware that has none of this built in.

The same engine powers the Touch button's generated routines, M6 tool-change subroutines, runtime hook conditions, and the pre-run bounds check. For reactive commands, GcodePilot waits for both the controller's semantic result and its terminal acknowledgement. They may arrive in either order, but a late result from an earlier command cannot satisfy the next one. Controller config reads also wait for those ordinary acknowledgements before temporarily taking over the connection, so a background config check cannot steal a reply from a probe or input read. Cancelling an operator-run routine is reported as Cancelled; only a real controller or program fault is shown as an error.

Pinned subroutine controls

A subroutine parameter pinned to the GcodePilot toolbar takes effect locally as soon as you change it. Its badge then reports whether that value is saving, pending for profile synchronization, or failed to save. The effective local value survives a restart, including when the linked profile's home computer is offline. A failed or unconfirmed save is never presented as durable profile state, and the local override clears automatically after the authoritative profile catches up.