Browse Learn topics

Learn/GcodePilot/Automation & safety

Runtime Hooks

Updated v2.5.7

At a glance

  • Watch live machine state and fire ordered action sequences — the crash / arc-loss recovery layer
  • Actions: feed hold, torch off, safe stop, park, run a subroutine, or a message with Continue
  • Continue jumps the program back in at the interruption point after you swap consumables
  • Conditions are full NGC expressions over live params (arc-OK, inputs, run state); Test Fire dry-runs a sequence

A hook watches the live machine state and fires an ordered sequence of actions when its condition holds — the orchestration layer for crash and arc-loss recovery. A typical recovery hook: feed hold, torch off, safe stop, park; the operator swaps consumables and presses Continue, which jumps the program back in at the interruption point and re-pierces.

Continuing after a crash

To resume the interrupted cut, finish the recovery sequence with a Message action and enable Resume interrupted cut on Continue. For a floating-head crash, a suitable sequence is Feed hold → Torch Off → Stop → Subroutine torch_off → Message. Native Torch Off extinguishes the torch immediately; the subroutine performs the existing THC-off and retract steps.

Resume position chooses either Where the event fired or Where motion stopped. The held line and marker show the captured resume point. Continue re-pierces and resumes; Stop clears the armed resume without starting a cut.

A message written inside Run G-code, such as (MSG, Crash detected), behaves differently: Continue only continues that recovery G-code. It does not restart the interrupted cut. Add the separate resumable Message action when that is the behavior you want. Existing hooks are not automatically changed.

Building a hook

Conditions are grouped field/operator/value rows compiled to a real NGC expression over live parameters (arc-OK, digital inputs, run state, cutting state — plus program variables while one runs); an Advanced toggle exposes the raw expression. Triggers control scope (always / streaming / cutting), edge vs level, debounce, holdoff, and re-arm behavior. Actions map to real transports: feed hold, torch off (M65), safe stop, park, subroutine call, raw g-code, or an operator message with an optional resume.

Hooks live on the machine profile — export and import them between machines. Nickname a hook and it gets a toolbar arm/disarm badge that flashes when it fires; Test Fire dry-runs the sequence with no machine I/O. Firmware remains the hard safety layer — hooks are recovery orchestration at status cadence, not an e-stop.