Mach Modules Documentation
Lua Module API Documentation
Loading...
Searching...
No Matches
PlasmaAuxModule.lua File Reference

Go to the source code of this file.

Functions

PlasmaAuxModule GetIsOnCutPath (Method)
 Determine whether the machine is currently on the plasma cut path.
PlasmaAuxModule CutRecoveryStop ()
 Stop an active cut recovery operation and reset all cut recovery state.
PlasmaAuxModule CheckGCodeModals ()
 Validate that active G-code modal groups are compatible with plasma shape cutting.

Function Documentation

◆ CheckGCodeModals()

PlasmaAuxModule CheckGCodeModals ( )

Validate that active G-code modal groups are compatible with plasma shape cutting.

Checks a predefined set of G-code modal groups against their required values for plasma shape cutting compatibility. The following modal groups are validated:

  • Group 2 (Active Plane): Must be G17 (XY-plane)
  • Group 3 (Distance Mode): Must be G90 (Absolute)
  • Group 4 (Arc Center Mode): Must be G90.1 (Absolute arc center)
  • Group 5 (Feed Rate Mode): Must be G94 (Units per minute)
  • Group 11 (Scale Mode): Must be G50 (Scale disabled)
  • Group 17 (Polar Mode): Must be G15 (Polar mode off) If any modal group does not match the required value, an error message is returned immediately.
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if all modals are valid for shape cutting, false if any are invalid
    (string) Status message describing which modal failed, or w.FunctionCompleted() on success
    Note
    Documentation generated by AI on 2026-03-03

◆ CutRecoveryStop()

PlasmaAuxModule CutRecoveryStop ( )

Stop an active cut recovery operation and reset all cut recovery state.

Checks whether any cut recovery operation (forward, backward, or general) is currently active. If so, it logs the stop event, clears all cut recovery state flags, resets the associated OEM registers, issues a cycle stop, restores the G-code line number from the cut recovery pound variable, and marks the machine as being on the cut path. If no cut recovery is active, the function returns nil with no action taken.

Returns
(boolean|nil) True if cut recovery was active and successfully stopped, nil if no recovery was active
(boolean) Success flag - true if operation completed successfully, false on error
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Warning
This function calls mc.mcCntlCycleStop() which halts machine motion immediately
Note
Documentation generated by AI on 2026-03-03

◆ GetIsOnCutPath()

PlasmaAuxModule GetIsOnCutPath ( Method )

Determine whether the machine is currently on the plasma cut path.

Supports three detection methods selected via the Method parameter:

  • Method 1: Checks the IsOnCutPath OEM register directly for a "Yes" value
  • Method 2: Combines Method 1 and Method 3 - returns true if either indicates on-path
  • Method 3 (default): Compares the distance from the current G-code line to the path against the OnPathTolerance OEM parameter using w.FindPath() When Method is nil or any value other than 1 or 2, Method 3 (distance check) is used.
    Parameters
    Method(number|nil) Detection method selector: 1 (register only), 2 (register or distance), or nil/other (distance only)
    Returns
    (boolean|nil) True if on cut path, false if not on cut path, nil on error
    (boolean) Success flag - true if the check completed successfully, false on error
    (string) Status message describing the result, distance information, or error details
    Note
    Documentation generated by AI on 2026-03-03