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

Go to the source code of this file.

Functions

GrinderSurfaceMCodeModule GetCurrentWheelHeadNumber ()
 Get the current wheel head number from OEM parameters.
GrinderSurfaceMCodeModule UpdateGrindStepOver ()
 Update the grinding step-over pound variable by applying the feedrate override.

Function Documentation

◆ GetCurrentWheelHeadNumber()

GrinderSurfaceMCodeModule GetCurrentWheelHeadNumber ( )

Get the current wheel head number from OEM parameters.

Retrieves the currently active wheel head number by reading the "WheelHeadCurrentNumber" OEM parameter register. This value is used by M170 and M171 to determine which wheel head output and input signals to activate or deactivate. Raises an error via w.Error() if the parameter cannot be read.

Returns
(number) The current wheel head number as stored in the WheelHeadCurrentNumber OEM parameter
Note
Documentation generated by AI on 2026-03-03

◆ UpdateGrindStepOver()

GrinderSurfaceMCodeModule UpdateGrindStepOver ( )

Update the grinding step-over pound variable by applying the feedrate override.

Reads the screen step-over value from pound variable #519 and the current feedrate override (FRO) percentage, then calculates the adjusted step-over by scaling the screen value by the FRO ratio. The result is written to pound variable #537 for use by the grinding program. This function is typically called to synchronize the programmatic step-over with any operator feedrate override adjustments made at the screen.

Note
No parameters or return values; errors are raised via w.Error() if any Mach4 API call fails
Warning
This function raises an error and does not return if mc.mcCntlGetFRO(), mc.mcCntlGetPoundVar(), or mc.mcCntlSetPoundVar() return a non-zero error code
Note
Documentation generated by AI on 2026-03-03