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

Go to the source code of this file.

Functions

GrinderODIDGUIModule MachineCycleStart ()
 Handle a machine cycle start event for the OD/ID grinder.
GrinderODIDGUIModule MachineFeedHold ()
 Handle a machine feedhold event for the OD/ID grinder.
GrinderODIDGUIModule MachineCycleStop ()
 Handle a machine cycle stop event for the OD/ID grinder.
GrinderODIDGUIModule StopHandwheelInfeedCycleWait ()
 Stop the handwheel infeed cycle immediately and wait for it to fully end.
GrinderODIDGUIModule WaitForHandwheelInfeedCycleEnd ()
 Wait for the handwheel infeed cycle to fully end, with reentrancy protection.
GrinderODIDGUIModule IsHandwheelInfeedStopping ()
 Check whether the handwheel infeed cycle is in the process of stopping.
GrinderODIDGUIModule IsHandwheelInfeedActive ()
 Check whether the handwheel infeed cycle is currently active.
GrinderODIDGUIModule IsFeedholdHandwheelInfeedCycleActive ()
 Check whether the handwheel infeed feedhold cycle is currently active.
GrinderODIDGUIModule StartHandwheelInfeedCycle (grinderdata)
 Start the handwheel infeed (G288) reciprocating cycle with optional grinder data.
GrinderODIDGUIModule StopHandwheelInfeedCycleAtA ()
 Stop the handwheel infeed cycle after the axis reaches position A.
GrinderODIDGUIModule StopHandwheelInfeedCycleAtB ()
 Stop the handwheel infeed cycle after the axis reaches position B.
GrinderODIDGUIModule StopHandwheelInfeedMidCycle ()
 Stop the handwheel infeed cycle at the midpoint of the current swing.
GrinderODIDGUIModule StopHandwheelInfeedCycle (stop_end)
 Stop the handwheel infeed cycle at a specified end point.
GrinderODIDGUIModule StartFeedholdHandwheelInfeedCycle ()
 Initiate a feedhold on the active handwheel infeed cycle.
GrinderODIDGUIModule StopFeedholdHandwheelInfeedCycle (restart)
 Stop the feedhold handwheel infeed cycle and optionally restart the main cycle.
GrinderODIDGUIModule InhibitJogOnNonG88Axes ()
 Inhibit jogging on all non-G88 (non-Z) axes during a handwheel infeed cycle.
GrinderODIDGUIModule ReleaseInhibitJogOnNonG88Axes ()
 Release jog inhibit on all non-G88 (non-Z) axes.
GrinderODIDGUIModule CycleStopRestoreGCodeLineNum (gcodeline)
 Restore the G-code line number after a cycle stop event.
GrinderODIDGUIModule MachinePreFeedHoldRetract ()
 Determine whether a pre-feedhold retract should proceed based on the RetractEnabled OEM parameter.

Function Documentation

◆ CycleStopRestoreGCodeLineNum()

GrinderODIDGUIModule CycleStopRestoreGCodeLineNum ( gcodeline )

Restore the G-code line number after a cycle stop event.

This function is a no-op stub for the OD/ID grinder machine type. On other grinder variants, this function would restore the G-code line number to a saved position after a cycle stop. For this grinder, no restoration is needed.

Parameters
gcodeline(number) The G-code line number to restore (unused in this implementation)
Note
Documentation generated by AI on 2026-03-03

◆ InhibitJogOnNonG88Axes()

GrinderODIDGUIModule InhibitJogOnNonG88Axes ( )

Inhibit jogging on all non-G88 (non-Z) axes during a handwheel infeed cycle.

Iterates from Y_AXIS to C_AXIS and applies a jog inhibit to each axis using w.InhibitJogOnAxis(). This prevents unintended axis movement on axes not controlled by the G88 handwheel infeed cycle while it is active.

See also
GrinderODIDGUIModule.ReleaseInhibitJogOnNonG88Axes() for the corresponding release function
Note
Documentation generated by AI on 2026-03-03

◆ IsFeedholdHandwheelInfeedCycleActive()

GrinderODIDGUIModule IsFeedholdHandwheelInfeedCycleActive ( )

Check whether the handwheel infeed feedhold cycle is currently active.

Reads the 'HandwheelInfeedFeedHoldActive' OEM parameter boolean value to determine if a feedhold of the handwheel infeed cycle is in progress.

Returns
(boolean|nil) True if the feedhold handwheel infeed cycle is active, nil on error
(boolean) Success flag - true if the parameter was read successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderODIDGUIModule.IsHandwheelInfeedActive() to check the main cycle state
Note
Documentation generated by AI on 2026-03-03

◆ IsHandwheelInfeedActive()

GrinderODIDGUIModule IsHandwheelInfeedActive ( )

Check whether the handwheel infeed cycle is currently active.

Reads the 'HandwheelInfeedActive' OEM parameter boolean value to determine if a G288 handwheel infeed grind cycle is currently running.

Returns
(boolean|nil) True if the handwheel infeed cycle is active, nil on error
(boolean) Success flag - true if the parameter was read successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderODIDGUIModule.IsFeedholdHandwheelInfeedCycleActive() to check feedhold state
Note
Documentation generated by AI on 2026-03-03

◆ IsHandwheelInfeedStopping()

GrinderODIDGUIModule IsHandwheelInfeedStopping ( )

Check whether the handwheel infeed cycle is in the process of stopping.

Queries the Z-axis reciprocating axis object to determine if a stop has been requested but motion has not yet fully ceased.

Returns
(boolean) True if the handwheel infeed cycle is currently stopping, false otherwise
See also
GrinderODIDGUIModule.IsHandwheelInfeedActive() to check if the cycle is running
Note
Documentation generated by AI on 2026-03-03

◆ MachineCycleStart()

GrinderODIDGUIModule MachineCycleStart ( )

Handle a machine cycle start event for the OD/ID grinder.

This function manages cycle start behavior when a G288 handwheel infeed cycle may be active. The logic proceeds as follows:

  1. If the handwheel infeed cycle is stopping, return false immediately.
  2. If a feedhold of the handwheel infeed cycle is active, end it and return false.
  3. If the handwheel infeed cycle is active, prompt the operator with a dialog asking whether to end the cycle. If confirmed, stops the cycle at position A and waits for it to end.
  4. If no handwheel cycle is active, saves the tool and fixture tables before allowing the normal cycle start to proceed.
    Returns
    (boolean|nil) nil on error, false if cycle start was intercepted, true to allow normal cycle start
    (boolean) Success flag - true if operation completed successfully
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    Note
    Documentation generated by AI on 2026-03-03

◆ MachineCycleStop()

GrinderODIDGUIModule MachineCycleStop ( )

Handle a machine cycle stop event for the OD/ID grinder.

Calls StopHandwheelInfeedCycleWait() to immediately halt any active handwheel infeed cycle and block until it has fully ended before returning.

Returns
(boolean) True indicating the cycle stop was processed
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
See also
GrinderODIDGUIModule.StopHandwheelInfeedCycleWait() for the underlying stop logic
Note
Documentation generated by AI on 2026-03-03

◆ MachineFeedHold()

GrinderODIDGUIModule MachineFeedHold ( )

Handle a machine feedhold event for the OD/ID grinder.

Checks whether the handwheel infeed cycle is active. If it is and it is not already stopping, initiates a feedhold on the handwheel infeed cycle via StartFeedholdHandwheelInfeedCycle() and returns false to indicate the feedhold was handled internally. If the cycle is not active, returns true to allow the standard feedhold sequence to proceed.

Returns
(boolean) False if feedhold was handled by the handwheel infeed cycle, true to allow standard feedhold
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
See also
GrinderODIDGUIModule.StartFeedholdHandwheelInfeedCycle() for the feedhold initiation
Note
Documentation generated by AI on 2026-03-03

◆ MachinePreFeedHoldRetract()

GrinderODIDGUIModule MachinePreFeedHoldRetract ( )

Determine whether a pre-feedhold retract should proceed based on the RetractEnabled OEM parameter.

Reads the 'RetractEnabled' OEM parameter to decide whether a retract motion should occur before feedhold. If retract is not enabled, it calls m.CycleStopBtn() and returns false to indicate the caller should not proceed with the retract. If retract is enabled, returns true to allow the caller to continue with the retract sequence.

Returns
(nil|boolean) nil on error, false if retract is disabled and cycle stop was issued, true if retract is enabled
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Documentation generated by AI on 2026-03-03

◆ ReleaseInhibitJogOnNonG88Axes()

GrinderODIDGUIModule ReleaseInhibitJogOnNonG88Axes ( )

Release jog inhibit on all non-G88 (non-Z) axes.

Iterates from Y_AXIS to C_AXIS and releases the jog inhibit on each axis using w.ReleaseInhibitJogOnAxis(). This is the counterpart to InhibitJogOnNonG88Axes() and should be called after a handwheel infeed cycle ends to restore normal jogging capability.

See also
GrinderODIDGUIModule.InhibitJogOnNonG88Axes() for the corresponding inhibit function
Note
Documentation generated by AI on 2026-03-03

◆ StartFeedholdHandwheelInfeedCycle()

GrinderODIDGUIModule StartFeedholdHandwheelInfeedCycle ( )

Initiate a feedhold on the active handwheel infeed cycle.

Sets the 'HandwheelInfeedFeedHoldActive' OEM parameter to true, then stops the current handwheel infeed cycle and waits for it to fully end before returning. This is called during a machine feedhold event when a handwheel infeed cycle is running.

See also
GrinderODIDGUIModule.StopFeedholdHandwheelInfeedCycle() for ending the feedhold
Note
Documentation generated by AI on 2026-03-03

◆ StartHandwheelInfeedCycle()

GrinderODIDGUIModule StartHandwheelInfeedCycle ( grinderdata )

Start the handwheel infeed (G288) reciprocating cycle with optional grinder data.

Inhibits jogging on all non-G88 axes, then optionally configures the Z-axis reciprocating axis with positions, dwell times (converted from seconds to milliseconds), and feedrates from the provided grinderdata table before starting the cycle. If grinderdata is nil, the cycle starts with previously configured parameters.

Parameters
grinderdata(table|nil) Optional table containing swing configuration with keys:
  • ["Swing 1"] (table): Table with 'Position' (number), 'Dwell' (number, seconds), 'Feedrate' (number)
  • ["Swing 2"] (table): Table with 'Position' (number), 'Dwell' (number, seconds), 'Feedrate' (number)
See also
GrinderODIDGUIModule.StopHandwheelInfeedCycleAtA() to stop the cycle at position A
Note
Dwell values in grinderdata are expected in seconds and are converted to milliseconds internally
Documentation generated by AI on 2026-03-03

◆ StopFeedholdHandwheelInfeedCycle()

GrinderODIDGUIModule StopFeedholdHandwheelInfeedCycle ( restart )

Stop the feedhold handwheel infeed cycle and optionally restart the main cycle.

Clears the 'HandwheelInfeedFeedHoldActive' OEM parameter. If restart is true (the default), calls m.StartHandwheelInfeedCycle() to resume the handwheel infeed cycle before clearing the feedhold flag. If restart is false or nil defaults to true, the cycle is not restarted.

Parameters
restart(boolean|nil) If true or nil, restart the handwheel infeed cycle after stopping feedhold. If false, stop without restarting
See also
GrinderODIDGUIModule.StartFeedholdHandwheelInfeedCycle() for initiating a feedhold
Note
Documentation generated by AI on 2026-03-03

◆ StopHandwheelInfeedCycle()

GrinderODIDGUIModule StopHandwheelInfeedCycle ( stop_end )

Stop the handwheel infeed cycle at a specified end point.

Checks whether the Z-axis reciprocating cycle is currently running or in feedhold, then issues the appropriate stop command based on the stop_end argument. Valid stop positions are "A" (stop at position A), "B" (stop at position B), "Mid" (stop mid-cycle), or any other value (immediate stop). After stopping, releases the jog inhibit on non-G88 axes.

Parameters
stop_end(string) The stop position: "A", "B", "Mid", or any other value for immediate stop
Returns
(boolean) True indicating the stop command was issued
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
See also
GrinderODIDGUIModule.StopHandwheelInfeedCycleAtA() for stopping at position A
GrinderODIDGUIModule.StopHandwheelInfeedCycleAtB() for stopping at position B
GrinderODIDGUIModule.StopHandwheelInfeedMidCycle() for stopping mid-cycle
Note
Documentation generated by AI on 2026-03-03

◆ StopHandwheelInfeedCycleAtA()

GrinderODIDGUIModule StopHandwheelInfeedCycleAtA ( )

Stop the handwheel infeed cycle after the axis reaches position A.

Convenience wrapper that calls StopHandwheelInfeedCycle("A") to request that the Z-axis reciprocating cycle complete its current swing and stop when it arrives at position A.

Returns
(boolean) True indicating the stop command was issued
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
See also
GrinderODIDGUIModule.StopHandwheelInfeedCycle() for the underlying implementation
Note
Documentation generated by AI on 2026-03-03

◆ StopHandwheelInfeedCycleAtB()

GrinderODIDGUIModule StopHandwheelInfeedCycleAtB ( )

Stop the handwheel infeed cycle after the axis reaches position B.

Convenience wrapper that calls StopHandwheelInfeedCycle("B") to request that the Z-axis reciprocating cycle complete its current swing and stop when it arrives at position B.

Returns
(boolean) True indicating the stop command was issued
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
See also
GrinderODIDGUIModule.StopHandwheelInfeedCycle() for the underlying implementation
Note
Documentation generated by AI on 2026-03-03

◆ StopHandwheelInfeedCycleWait()

GrinderODIDGUIModule StopHandwheelInfeedCycleWait ( )

Stop the handwheel infeed cycle immediately and wait for it to fully end.

Clears the 'HandwheelInfeedFeedHoldActive' OEM parameter, then checks if the Z-axis reciprocating cycle is running. If it is, calls StopHandwheelInfeedMidCycle() to halt motion and then waits for the cycle to finish via WaitForHandwheelInfeedCycleEnd().

See also
GrinderODIDGUIModule.StopHandwheelInfeedMidCycle() for the stop call
GrinderODIDGUIModule.WaitForHandwheelInfeedCycleEnd() for the wait call
Note
Documentation generated by AI on 2026-03-03

◆ StopHandwheelInfeedMidCycle()

GrinderODIDGUIModule StopHandwheelInfeedMidCycle ( )

Stop the handwheel infeed cycle at the midpoint of the current swing.

Convenience wrapper that calls StopHandwheelInfeedCycle("Mid") to halt the Z-axis reciprocating cycle at whatever point it is currently at, without waiting for position A or B to be reached.

Returns
(boolean) True indicating the stop command was issued
(boolean) Success flag - true if operation completed successfully
(string) Status message from w.FunctionCompleted()
See also
GrinderODIDGUIModule.StopHandwheelInfeedCycle() for the underlying implementation
Note
Documentation generated by AI on 2026-03-03

◆ WaitForHandwheelInfeedCycleEnd()

GrinderODIDGUIModule WaitForHandwheelInfeedCycleEnd ( )

Wait for the handwheel infeed cycle to fully end, with reentrancy protection.

Uses w.FuncTracing to prevent concurrent calls. If the wait is already in progress, returns immediately with an error. Otherwise, delegates to m._WaitForHandwheelInfeedCycleEnd() via w.pcall() for protected execution. The tracing flag is always cleared after the call, even if an error occurs.

Returns
(any) Primary return value from _WaitForHandwheelInfeedCycleEnd, or nil on error
(boolean) Success flag - true if the wait completed successfully
(string) Status message or error description
Warning
This function uses reentrancy protection; calling it recursively will return an error
See also
GrinderODIDGUIModule._WaitForHandwheelInfeedCycleEnd() for the underlying wait implementation
Note
Documentation generated by AI on 2026-03-03