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

Go to the source code of this file.

Functions

GrinderCenterlessGUIModule ScreenLoadScript ()
 Initialize the centerless grinder screen on load, configuring signals, UI, and OEM parameters.
GrinderCenterlessGUIModule GetRegulatingWheelSpeed ()
 Get the commanded regulating wheel speed from pound variable #516.
GrinderCenterlessGUIModule SetRegulatingWheelSpeed (CmdSpeed,...)
 Set the regulating wheel speed by scaling RPM and writing to the hardware register.
GrinderCenterlessGUIModule GetRegulatingWheelDirection ()
 Get the current rotation direction of the regulating wheel from output register states.
GrinderCenterlessGUIModule SetRegulatingWheelDirection (Direction)
 Set the regulating wheel rotation direction by writing forward/reverse output registers.
GrinderCenterlessGUIModule GetUpperLowerAxisID ()
 Get the axis ID of the currently selected upper or lower slide.
GrinderCenterlessGUIModule ResetTotalCompBtn (AxisID)
 Reset the total compensation accumulator for a specific axis to zero.
GrinderCenterlessGUIModule ResetPartCounterBtn ()
 Reset the part counter display and pound variable to zero.
GrinderCenterlessGUIModule ResetUpperLowerTotalCompBtn ()
 Reset the total compensation accumulator for the currently selected upper/lower axis.
GrinderCenterlessGUIModule ThruFeedCompMainGrindAxis (Direction, Amount)
 Apply a thru-feed compensation move to the currently selected main grind axis.
GrinderCenterlessGUIModule CompMainGrindAxis (Type, Direction, Amount)
 Apply a compensation move to the currently selected main grind axis.
GrinderCenterlessGUIModule Comp (AxisID, Type, Direction, Amount)
 Apply a compensation move to the specified axis using G-code MDI execution.
GrinderCenterlessGUIModule ThruFeedInBtn ()
 Move the active slide axis to the thru-feed in (zero) position.
GrinderCenterlessGUIModule ThruFeedOutBtn ()
 Move the active slide axis to the thru-feed retract (out) position.
GrinderCenterlessGUIModule UpperSlideBtn ()
 Select the upper slide axis as the active compensation axis.
GrinderCenterlessGUIModule LowerSlideBtn ()
 Select the lower slide axis as the active compensation axis.
GrinderCenterlessGUIModule RepeatToggleBtn ()
 Toggle the auto-loader repeat mode on or off in response to an operator button press.
GrinderCenterlessGUIModule StartHydraulics ()
 Enable the hydraulic system output signal.
GrinderCenterlessGUIModule StopHydraulics ()
 Stop the hydraulic system and shut down all dependent wheel outputs.
GrinderCenterlessGUIModule HydraulicsToggleBtn ()
 Toggle the hydraulic system on or off in response to an operator button press.
GrinderCenterlessGUIModule StartRegulatingWheel ()
 Start the regulating wheel after verifying hydraulic pressure and setting speed/direction.
GrinderCenterlessGUIModule StopRegulatingWheel ()
 Stop the regulating wheel and clear its direction outputs.
GrinderCenterlessGUIModule RegulatingWheelToggleBtn ()
 Toggle the regulating wheel on or off in response to an operator button press.
GrinderCenterlessGUIModule StartGrindingWheel ()
 Start the grinding wheel spindle after verifying hydraulic and regulating wheel interlocks.
GrinderCenterlessGUIModule StopGrindingWheel ()
 Stop the grinding wheel spindle and turn off coolant.
GrinderCenterlessGUIModule GrindingWheelToggleBtn ()
 Toggle the grinding wheel on or off in response to an operator button press.
GrinderCenterlessGUIModule GrindDressCycleStartBtn ()
 Start the grind dress cycle from the operator panel or physical button.
GrinderCenterlessGUIModule UpdateGrinderControls ()
 Update high-priority grinder UI controls for slide selection, position LEDs, and thru-feed state.
GrinderCenterlessGUIModule UpdateLowPriorityGrinderControls ()
 Update low-priority grinder UI controls including wheel buttons, counters, and comp labels.
GrinderCenterlessGUIModule PLCScript ()
 Execute the high-priority PLC update loop for the centerless grinder screen.
GrinderCenterlessGUIModule LowPriorityLoop ()
 Execute the low-priority periodic update loop for the centerless grinder screen.
GrinderCenterlessGUIModule ToggleMDI ()
 Toggle the MDI input panel visibility with password protection.
GrinderCenterlessGUIModule CycleStop ()
 Execute the centerless grinder cycle stop sequence with automatic axis retract.
GrinderCenterlessGUIModule CycleStart ()
 Execute the centerless grinder cycle start sequence with full pre-flight checks.
GrinderCenterlessGUIModule ZeroYOperatorPanelBtn ()
 Zero the Y axis position at the current location via operator panel button.
GrinderCenterlessGUIModule CoolantToggleBtn ()
 Toggle coolant on or off in response to an operator button press.
GrinderCenterlessGUIModule CoolantOff ()
 Turn off coolant output unconditionally.
GrinderCenterlessGUIModule PositionDisplayUnLocked (Password)
 Switch the position display to unlocked (editable) mode with optional password protection.
GrinderCenterlessGUIModule UpdateStackLight ()
 Update the stack light outputs based on current machine alarm and run state.

Function Documentation

◆ Comp()

GrinderCenterlessGUIModule Comp ( AxisID ,
Type ,
Direction ,
Amount  )

Apply a compensation move to the specified axis using G-code MDI execution.

Performs the actual compensation move after validating the amount and determining direction. The compensation amount is read from pound variable #508 (Coarse) or #509 (Fine) based on the Amount parameter string. A safety check rejects comp values greater than 0.100 units. Two move types are supported:

  • Type 1: Adjusts the G54 fixture offset only (G91 G10 L2 P1), leaving axis position unchanged
  • Type 2: Adjusts the fixture offset AND rapids the axis to the new zero position (G90) The cumulative compensation is tracked in the TOTAL_COMP table indexed by axis ID, and the action is logged via mc.mcCntlLog().
    Parameters
    AxisID(number) The axis constant (e.g., mc.B_AXIS, mc.C_AXIS) to compensate
    Type(number) Move type: 1 = adjust offset only, 2 = adjust offset and move to zero
    Direction(number) Direction of compensation: 1 = positive, any other value = negative
    Amount(string|number) Comp step size: "Coarse" reads #508, "Fine" reads #509, or a numeric value
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if compensation was applied, false if validation failed
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    Warning
    Comp values exceeding 0.100 units are rejected with an error message
    See also
    GrinderCenterlessGUIModule.CompMainGrindAxis() for the higher-level axis selection wrapper
    Note
    Documentation generated by AI on 2026-03-03

◆ CompMainGrindAxis()

GrinderCenterlessGUIModule CompMainGrindAxis ( Type ,
Direction ,
Amount  )

Apply a compensation move to the currently selected main grind axis.

Resolves the active upper/lower axis ID via GetUpperLowerAxisID() (pound variable #513), then delegates the compensation move to Comp() with the resolved axis ID. This function serves as the bridge between operator actions and the low-level Comp() implementation.

Parameters
Type(number) Move type: 1 = adjust offset only, 2 = adjust offset and move to zero
Direction(number) Direction of compensation: 1 = positive, any other value = negative
Amount(string|number) Comp step size: "Coarse" reads #508, "Fine" reads #509
Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if compensation completed successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.Comp() for the low-level compensation implementation
GrinderCenterlessGUIModule.GetUpperLowerAxisID() for active axis resolution
Note
Documentation generated by AI on 2026-03-03

◆ CoolantOff()

GrinderCenterlessGUIModule CoolantOff ( )

Turn off coolant output unconditionally.

Sets the OSIG_COOLANTON signal to false and logs the action to the operator log. Unlike CoolantToggleBtn, this function does not check machine state or MST/Dry Run conditions. It is called internally by StopGrindingWheel to ensure coolant is always turned off when the grinding wheel stops.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - always true
(string) Status message from w.FunctionCompleted()
See also
GrinderCenterlessGUIModule.CoolantToggleBtn() for operator-facing coolant toggle
GrinderCenterlessGUIModule.StopGrindingWheel() for the primary caller
Note
Documentation generated by AI on 2026-03-03

◆ CoolantToggleBtn()

GrinderCenterlessGUIModule CoolantToggleBtn ( )

Toggle coolant on or off in response to an operator button press.

Checks MST Lock and Dry Run OEM register values before allowing coolant changes. If either is active, displays a warning and returns without changing coolant state. Additionally requires the grinding wheel spindle (OSIG_SPINDLEON) to be running before coolant can be turned on. If all checks pass, toggles OSIG_COOLANTON between true and false.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if coolant state changed or skipped gracefully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Warning
Coolant cannot be enabled if the grinding wheel spindle is not running
Note
MST Lock or Dry Run active conditions are treated as non-error skips, not failures
Documentation generated by AI on 2026-03-03

◆ CycleStart()

GrinderCenterlessGUIModule CycleStart ( )

Execute the centerless grinder cycle start sequence with full pre-flight checks.

Performs a comprehensive sequence of checks and actions before starting or resuming a cycle:

  1. Logs the cycle start and updates stop status
  2. Releases any active cycle start hold if present
  3. Calls user.UserCycleStart hook if defined
  4. When IDLE: warns if Feed OV or Rapid OV is below 1%, warns about DRO mode, warns about MST Lock/Dry Run
  5. Checks for active manual mode
  6. Checks for active GMS alarms or warnings
  7. Verifies machine homing status
  8. Handles GOTO_POSITION_MODE and MDI window visibility
  9. Checks Run From Here dialog state
  10. Calls user.UserCycleStartFinal hook if defined
  11. Reads current screen tab and sets pound variable #514
  12. Shows confirmation dialogs for Grind Dress (tab 5) and Reg Dress (tab 6)
  13. Checks parts quota for Infeed/Thru Feed tabs (3 and 4)
  14. Executes mc.mcCntlCycleStart() or returns early based on tab and state
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if cycle started or gracefully skipped
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    Warning
    Machine must be homed before cycle start will proceed
    All GMS alarms and warnings must be cleared before cycle start
    See also
    GrinderCenterlessGUIModule.VerifyHoming() for homing status check
    GrinderCenterlessGUIModule.ManualModeIsActive() for manual mode check
    Note
    Documentation generated by AI on 2026-03-03

◆ CycleStop()

GrinderCenterlessGUIModule CycleStop ( )

Execute the centerless grinder cycle stop sequence with automatic axis retract.

Performs the following sequence on cycle stop:

  1. Records the current G-code line number for restoration
  2. Reads and then clears pound variable #543 (CurrentOperation) to prevent stale state
  3. If machine is in HOME state, disables the machine and shows a warning
  4. Otherwise calls mc.mcCntlCycleStop()
  5. If the machine is homed, determines the appropriate retract G-code based on CurrentOperation or the current screen tab (Infeed retract from #506, Thru Feed retract from #507, Grind Dress returns to G53 Y0/X0, Reg Dress returns to G53 U0/Z0)
  6. Executes the retract MDI command and waits for IDLE state
  7. Calls mc.mcCntlReset() and user.UserCycleStop hook if defined
  8. Executes MachineStop.mcs private script
  9. Turns off all non-exempt output signals respecting IgnoreOutputsOnStop and aux button lists
  10. Restores the saved G-code line number
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if cycle stop completed
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    Warning
    If machine is homing, this function disables the machine instead of stopping the cycle
    Machine must be homed for automatic retract to occur; un-homed machines show a warning
    Note
    Documentation generated by AI on 2026-03-03

◆ GetRegulatingWheelDirection()

GrinderCenterlessGUIModule GetRegulatingWheelDirection ( )

Get the current rotation direction of the regulating wheel from output register states.

Reads the RegulatingWheelFWD and RegulatingWheelREV OEM parameter registers and interprets the combination to determine direction. Returns 1 if FWD=1 and REV=0, returns -1 if FWD=0 and REV=1, and returns 0 for any other combination (stopped or invalid state).

Returns
(number|nil) Direction: 1 = forward, -1 = reverse, 0 = stopped/invalid, or nil on error
(boolean) Success flag - true if registers were read successfully
(string) "FunctionCompleted" on success, or error message on failure
See also
GrinderCenterlessGUIModule.SetRegulatingWheelDirection() for writing direction
Note
Documentation generated by AI on 2026-03-03

◆ GetRegulatingWheelSpeed()

GrinderCenterlessGUIModule GetRegulatingWheelSpeed ( )

Get the commanded regulating wheel speed from pound variable #516.


Reads pound variable #516 (Commanded Regulating Wheel RPM) which stores the last speed value written by SetRegulatingWheelSpeed(). This reflects the commanded speed, not necessarily the actual measured wheel speed.

Returns
(number|nil) The commanded regulating wheel speed in RPM, or nil on error
(boolean) Success flag - true if pound variable was read successfully
(string) "FunctionCompleted" on success, or error message from w.FunctionError()
See also
GrinderCenterlessGUIModule.SetRegulatingWheelSpeed() for setting the speed
Note
Documentation generated by AI on 2026-03-03

◆ GetUpperLowerAxisID()

GrinderCenterlessGUIModule GetUpperLowerAxisID ( )

Get the axis ID of the currently selected upper or lower slide.

Reads pound variable #513 (Upper Lower Slide Selection) and validates that the value corresponds to a valid upper or lower axis (mc.B_AXIS = 4 or mc.C_AXIS = 5). If the value is not 4 or 5, returns an error indicating the axis ID is not configured.

Returns
(number|nil) The axis ID constant (mc.B_AXIS or mc.C_AXIS), or nil on error
(boolean) Success flag - true if a valid axis ID was found
(string) Error message if axis ID is invalid, or "FunctionCompleted" on success
Note
Pound variable #513 must be set to 4 (mc.B_AXIS) or 5 (mc.C_AXIS); other values return an error
See also
GrinderCenterlessGUIModule.UpperSlideBtn() for setting axis to mc.B_AXIS
GrinderCenterlessGUIModule.LowerSlideBtn() for setting axis to mc.C_AXIS
Note
Documentation generated by AI on 2026-03-03

◆ GrindDressCycleStartBtn()

GrinderCenterlessGUIModule GrindDressCycleStartBtn ( )

Start the grind dress cycle from the operator panel or physical button.

Checks the current screen tab (MainWindowTabs). If the active tab is tab 5 (Grind Dress), calls m.CycleStartBtn() to begin the cycle. If any other tab is active, sets a warning message informing the operator that cycle start was ignored because they are not on the Grind Dress page.

Note
Tab numbering is 1-based (tab property value + 1)
Documentation generated by AI on 2026-03-03

◆ GrindingWheelToggleBtn()

GrinderCenterlessGUIModule GrindingWheelToggleBtn ( )

Toggle the grinding wheel on or off in response to an operator button press.

Reads the GrindingWheelOuput OEM parameter signal to determine the current state. If the grinding wheel output is active, calls m.StopGrindingWheel(). If the output is inactive, calls m.StartGrindingWheel(). The actual interlock checks (hydraulics, regulating wheel) are performed inside StartGrindingWheel.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if toggle completed or start/stop was initiated
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.StartGrindingWheel() for startup interlock details
GrinderCenterlessGUIModule.StopGrindingWheel() for shutdown sequence
Note
Documentation generated by AI on 2026-03-03

◆ HydraulicsToggleBtn()

GrinderCenterlessGUIModule HydraulicsToggleBtn ( )

Toggle the hydraulic system on or off in response to an operator button press.

Reads the current state of the HydraulicsOuput OEM parameter signal. If hydraulics are currently on, calls StopHydraulics() which also stops the regulating and grinding wheels before turning off the hydraulic output. If hydraulics are off, calls StartHydraulics() to enable the hydraulic output signal.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if toggle completed
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.StartHydraulics() for the enable sequence
GrinderCenterlessGUIModule.StopHydraulics() for the shutdown sequence including wheel stops
Note
Documentation generated by AI on 2026-03-03

◆ LowerSlideBtn()

GrinderCenterlessGUIModule LowerSlideBtn ( )

Select the lower slide axis as the active compensation axis.

Sets pound variable #513 to LOWER_SLIDE_AXIS_ID (mc.C_AXIS) to designate the lower slide as the active axis for all subsequent compensation and thru-feed operations. The UI button highlight update is handled by UpdateGrinderControls() on the next PLC cycle.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if pound variable was set successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.UpperSlideBtn() for selecting the upper slide axis
GrinderCenterlessGUIModule.GetUpperLowerAxisID() for reading the active axis selection
Note
Documentation generated by AI on 2026-03-03

◆ LowPriorityLoop()

GrinderCenterlessGUIModule LowPriorityLoop ( )

Execute the low-priority periodic update loop for the centerless grinder screen.

Delegates entirely to UpdateLowPriorityGrinderControls(). Called on a lower-frequency timer cycle than PLCScript to update controls that do not require high-frequency refresh, such as wheel button states, part counters, and comp button labels.

See also
GrinderCenterlessGUIModule.UpdateLowPriorityGrinderControls() for implementation details
Note
Documentation generated by AI on 2026-03-03

◆ PLCScript()

GrinderCenterlessGUIModule PLCScript ( )

Execute the high-priority PLC update loop for the centerless grinder screen.

Called on every PLC cycle to refresh the screen. Performs three sequential updates:

  1. Updates feedrate text labels and DROs via screen.UpdateFeedrateDROLabels()
  2. Updates axis DRO position displays via screen.UpdateDROPostions()
  3. Updates grinder-specific controls (slide selection, LEDs, thru-feed buttons) via UpdateGrinderControls()
    See also
    GrinderCenterlessGUIModule.UpdateGrinderControls() for grinder control update details
    Note
    Documentation generated by AI on 2026-03-03

◆ PositionDisplayUnLocked()

GrinderCenterlessGUIModule PositionDisplayUnLocked ( Password )

Switch the position display to unlocked (editable) mode with optional password protection.

Hides the locked and DRO position display groups and shows the unlocked position display group. Enables a wide range of UI controls including fixture offsets, tool offsets, edge finder buttons, and tool table access. For grinder-specific behavior, axis position DROs (X, Y, Z, A, B, C) are set to editor mode 3 (keypad/read-only) to prevent direct operator edits, while tool diameter and length DROs are set to editor mode 1. Calls user.UserPositionDisplayUnLocked hook if defined.

Parameters
Password(boolean) If true, requires password level 1 authentication before unlocking
Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if unlocked successfully, false if password check fails
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Axis position DROs are intentionally kept non-editable (editor mode 3) as a grinder-specific customization
Documentation generated by AI on 2026-03-03

◆ RegulatingWheelToggleBtn()

GrinderCenterlessGUIModule RegulatingWheelToggleBtn ( )

Toggle the regulating wheel on or off in response to an operator button press.

Reads the RegulatingWheelOuput OEM parameter signal to determine the current state. If the regulating wheel output is active, calls StopRegulatingWheel() and also calls StopGrindingWheel() to enforce the interlock (grinding wheel cannot run without regulating wheel). If the output is inactive, calls StartRegulatingWheel().

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if toggle completed
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.StartRegulatingWheel() for startup interlock details
GrinderCenterlessGUIModule.StopRegulatingWheel() for shutdown sequence
Note
Stopping the regulating wheel also stops the grinding wheel to maintain safe operating order
Documentation generated by AI on 2026-03-03

◆ RepeatToggleBtn()

GrinderCenterlessGUIModule RepeatToggleBtn ( )

Toggle the auto-loader repeat mode on or off in response to an operator button press.

Reads pound variable #538 (Repeat flag). If the current value is 1 (repeat enabled), sets it to 0 (disabled). If the current value is not 1, sets it to 1 (enabled). The button color update reflecting the new state is handled by UpdateLowPriorityGrinderControls() on the next low-priority loop cycle.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if the repeat flag was toggled successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Note
Documentation generated by AI on 2026-03-03

◆ ResetPartCounterBtn()

GrinderCenterlessGUIModule ResetPartCounterBtn ( )

Reset the part counter display and pound variable to zero.

Sets the PartCounterDRO screen object value to 0 and writes 0 to pound variable #540 (PartsFinished). This resets the auto-loader finished parts count so a new production run can begin without triggering the parts quota check in CycleStart().

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if the part counter was reset successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.CycleStart() for the parts quota check that uses this counter
Note
Documentation generated by AI on 2026-03-03

◆ ResetTotalCompBtn()

GrinderCenterlessGUIModule ResetTotalCompBtn ( AxisID )

Reset the total compensation accumulator for a specific axis to zero.

Sets the TOTAL_COMP table entry at index (AxisID + 1) to 0, clearing the running compensation total for the specified axis. The updated value will be reflected in the corresponding DRO (TotalUCompDRO, TotalYCompDRO, or TotalUpperLowerCompDRO) on the next UpdateGrinderControls() cycle.

Parameters
AxisID(number) The axis constant (e.g., mc.B_AXIS, mc.C_AXIS) whose total comp to reset
Returns
(nil) No meaningful primary return value
(boolean) Success flag - always true
(string) Status message from w.FunctionCompleted()
See also
GrinderCenterlessGUIModule.ResetUpperLowerTotalCompBtn() for resetting the active slide axis
GrinderCenterlessGUIModule.Comp() for the function that accumulates TOTAL_COMP values
Note
Documentation generated by AI on 2026-03-03

◆ ResetUpperLowerTotalCompBtn()

GrinderCenterlessGUIModule ResetUpperLowerTotalCompBtn ( )

Reset the total compensation accumulator for the currently selected upper/lower axis.

Resolves the active upper/lower axis ID via GetUpperLowerAxisID() (pound variable #513), then calls ResetTotalCompBtn() to zero the TOTAL_COMP entry for that axis. This clears the running compensation total displayed in TotalUpperLowerCompDRO.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if the total comp was reset successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.ResetTotalCompBtn() for the per-axis reset implementation
GrinderCenterlessGUIModule.GetUpperLowerAxisID() for active axis resolution
Note
Documentation generated by AI on 2026-03-03

◆ ScreenLoadScript()

GrinderCenterlessGUIModule ScreenLoadScript ( )

Initialize the centerless grinder screen on load, configuring signals, UI, and OEM parameters.

Performs the full screen initialization sequence:

  1. Sets global constants: BTN_COLOR_STAGE_1/2/3, TOTAL_COMP array, UPPER_SLIDE_AXIS_ID (mc.B_AXIS), LOWER_SLIDE_AXIS_ID (mc.C_AXIS)
  2. Resets pound variable #542 (Parts Since Last Dress) to zero
  3. Sets RepeatToggleBtn color based on pound variable #538 (Repeat flag)
  4. Enables or disables UpperSlideBtn and LowerSlideBtn based on AXIS_ENABLED array
  5. Builds the MACHINE_TYPE_SIG_LIBRARY_INST signal dispatch table for all instances, including output LEDs (Coarse/Medium/Fine/Dwell) and input-driven jog, comp, and cycle start signals
  6. Calls m.SetJogModeContinuous() to initialize jog mode
  7. Reads InFeedEnabled, ThruFeedEnabled, GrindDressEnabled, and HydraulicsEnabled OEM parameters and shows/hides the corresponding UI groups accordingly
  8. Calls m.screen.SetupRegulatingDress() to initialize the regulating dress UI group
  9. Turns off axis highlight colors for B and C axis text, home, and zero buttons
    Returns
    (nil) No meaningful primary return value on error paths
    (boolean) false on error (OEM parameter read failure or pound variable write failure)
    (string) Error message from w.FunctionError() on failure; no return on success
    Note
    This function is called automatically by the Common GUI Module framework on screen load
    Documentation generated by AI on 2026-03-03

◆ SetRegulatingWheelDirection()

GrinderCenterlessGUIModule SetRegulatingWheelDirection ( Direction )

Set the regulating wheel rotation direction by writing forward/reverse output registers.

Controls the RegulatingWheelFWD and RegulatingWheelREV OEM parameter registers to establish motor direction. Three states are supported:

  • Direction 1 (forward): Sets FWD=1, REV=0
  • Direction -1 (reverse): Sets FWD=0, REV=1
  • Any other value (stop/neutral): Sets FWD=0, REV=0
    Parameters
    Direction(number) Desired direction: 1 = forward, -1 = reverse, 0 = neutral/stop
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if all register writes completed successfully
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    See also
    GrinderCenterlessGUIModule.GetRegulatingWheelDirection() for reading the current direction
    GrinderCenterlessGUIModule.StartRegulatingWheel() for the full wheel start sequence
    Note
    Documentation generated by AI on 2026-03-03

◆ SetRegulatingWheelSpeed()

GrinderCenterlessGUIModule SetRegulatingWheelSpeed ( CmdSpeed ,
... )

Set the regulating wheel speed by scaling RPM and writing to the hardware register.

If CmdSpeed is provided, writes it to pound variable #516 before processing. If CmdSpeed is nil, reads the current value from pound variable #516. The speed is then clamped to the RegulatingWheelMaxRPM OEM parameter value if it exceeds the maximum. The clamped RPM is scaled from the range [0, RegulatingWheelMaxRPM] to the DAC range [0, 2047] using w.Scale(), and the result is written to the RegulatingWheelRPM OEM parameter register.

Parameters
CmdSpeed(number|nil) The desired speed in RPM to set, or nil to use the current #516 value
...(any) Additional arguments (accepted but unused)
Returns
(number|nil) The actual speed value used (after clamping), or nil on error
(boolean) Success flag - true if speed was set successfully
(string) "FunctionCompleted" on success, or error message from w.FunctionError()
See also
GrinderCenterlessGUIModule.GetRegulatingWheelSpeed() for reading the current commanded speed
GrinderCenterlessGUIModule.StartRegulatingWheel() for the full start sequence
Note
Documentation generated by AI on 2026-03-03

◆ StartGrindingWheel()

GrinderCenterlessGUIModule StartGrindingWheel ( )

Start the grinding wheel spindle after verifying hydraulic and regulating wheel interlocks.

Performs the following sequence:

  1. Reads HydraulicsPressureInput signal and HydraulicsEnabled OEM parameter. If hydraulics are enabled but pressure is not confirmed, shows a warning and returns an error.
  2. Reads RegulatingWheelOuput signal. If the regulating wheel is not running, shows a warning and returns an error.
  3. Sets GrindingWheelOuput signal to true.
  4. Reads grinding wheel RPM from pound variable #511 and sets the spindle command RPM via mc.mcSpindleSetCommandRPM().
  5. Sets spindle direction to mc.MC_SPINDLE_FWD.
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if grinding wheel started successfully
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    Warning
    Hydraulics must be running (pressure confirmed) before the grinding wheel can start
    The regulating wheel must be running before the grinding wheel can start
    See also
    GrinderCenterlessGUIModule.StartRegulatingWheel() for the required prerequisite
    Note
    Documentation generated by AI on 2026-03-03

◆ StartHydraulics()

GrinderCenterlessGUIModule StartHydraulics ( )

Enable the hydraulic system output signal.

Sets the HydraulicsOuput OEM parameter signal to true to start the hydraulic system. Does not perform any interlock checks - the caller is responsible for verifying machine state before calling this function. Typically called by HydraulicsToggleBtn().

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if the hydraulic output was set successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.StopHydraulics() for the complementary stop function
GrinderCenterlessGUIModule.HydraulicsToggleBtn() for the operator-facing toggle
Note
Documentation generated by AI on 2026-03-03

◆ StartRegulatingWheel()

GrinderCenterlessGUIModule StartRegulatingWheel ( )

Start the regulating wheel after verifying hydraulic pressure and setting speed/direction.

Performs the following sequence:

  1. Reads HydraulicsPressureInput signal and HydraulicsEnabled OEM parameter. If hydraulics are enabled but pressure is not confirmed, shows a warning via m.SetWarningMessage() and returns an error.
  2. Reads the regulating wheel speed from pound variable #510.
  3. Calls m.SetRegulatingWheelSpeed() to scale and write the speed to the RegulatingWheelRPM register.
  4. Calls m.SetRegulatingWheelDirection(1) to set the forward direction outputs.
  5. Sets the RegulatingWheelOuput OEM parameter signal to true.
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if regulating wheel started successfully
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    Warning
    Hydraulics must be running with confirmed pressure before the regulating wheel can start
    See also
    GrinderCenterlessGUIModule.SetRegulatingWheelSpeed() for speed scaling logic
    GrinderCenterlessGUIModule.StopRegulatingWheel() for the complementary stop function
    Note
    Documentation generated by AI on 2026-03-03

◆ StopGrindingWheel()

GrinderCenterlessGUIModule StopGrindingWheel ( )

Stop the grinding wheel spindle and turn off coolant.

Sets the GrindingWheelOuput OEM parameter signal to false, calls CoolantOff() to ensure coolant is also disabled, then sets the spindle direction to mc.MC_SPINDLE_OFF via mc.mcSpindleSetDirection().

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if all stop commands completed successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.CoolantOff() for coolant shutdown
GrinderCenterlessGUIModule.StartGrindingWheel() for the complementary start function
Note
Documentation generated by AI on 2026-03-03

◆ StopHydraulics()

GrinderCenterlessGUIModule StopHydraulics ( )

Stop the hydraulic system and shut down all dependent wheel outputs.

Calls StopRegulatingWheel() and StopGrindingWheel() to ensure both wheels are stopped before turning off the hydraulic output. Then sets the HydraulicsOuput OEM parameter signal to false. This ensures a safe shutdown sequence where dependent systems are disabled before hydraulic pressure is removed.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if all stop commands completed successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.StopRegulatingWheel() for regulating wheel shutdown
GrinderCenterlessGUIModule.StopGrindingWheel() for grinding wheel shutdown
GrinderCenterlessGUIModule.StartHydraulics() for the complementary start function
Note
Documentation generated by AI on 2026-03-03

◆ StopRegulatingWheel()

GrinderCenterlessGUIModule StopRegulatingWheel ( )

Stop the regulating wheel and clear its direction outputs.

Sets the RegulatingWheelOuput OEM parameter signal to false, then calls SetRegulatingWheelDirection(0) to clear both the forward and reverse direction output signals (RegulatingWheelFWD and RegulatingWheelREV).

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if all stop commands completed successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.SetRegulatingWheelDirection() for direction register control
GrinderCenterlessGUIModule.StartRegulatingWheel() for the complementary start function
Note
Documentation generated by AI on 2026-03-03

◆ ThruFeedCompMainGrindAxis()

GrinderCenterlessGUIModule ThruFeedCompMainGrindAxis ( Direction ,
Amount  )

Apply a thru-feed compensation move to the currently selected main grind axis.

Verifies that the thru-feed in button is active (ThruFeedInBtn color is not BTN_COLOR_OFF) before allowing compensation. If the thru-feed is not engaged, shows a warning and returns without applying comp. Then determines the compensation type based on the current axis position: if the axis is within 0.001 units of zero, uses Type 2 (adjust offset and move to new zero); otherwise uses Type 1 (adjust offset only). Delegates to CompMainGrindAxis() with the resolved type.

Parameters
Direction(number) Direction of compensation: 1 = positive (out), -1 = negative (in)
Amount(string) Comp step size: "Coarse" reads pound variable #508, "Fine" reads #509
Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if compensation was applied or gracefully skipped
(string) Status message from w.FunctionCompleted() or w.FunctionError()
Warning
Compensation is blocked if the thru-feed in position is not active
See also
GrinderCenterlessGUIModule.CompMainGrindAxis() for the compensation delegate
Note
Documentation generated by AI on 2026-03-03

◆ ThruFeedInBtn()

GrinderCenterlessGUIModule ThruFeedInBtn ( )

Move the active slide axis to the thru-feed in (zero) position.

Executes an MDI command (G90 G00) to move the currently selected upper/lower axis to the absolute zero position. The active axis is determined by GetUpperLowerAxisID() which reads pound variable #513. This represents the fully-in thru-feed position.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if MDI command was issued successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.ThruFeedOutBtn() for moving to the thru-feed retract position
GrinderCenterlessGUIModule.GetUpperLowerAxisID() for active axis selection
Note
Documentation generated by AI on 2026-03-03

◆ ThruFeedOutBtn()

GrinderCenterlessGUIModule ThruFeedOutBtn ( )

Move the active slide axis to the thru-feed retract (out) position.

Reads the thru-feed retract distance from pound variable #507, then executes an MDI command (G90 G00) to move the currently selected upper/lower axis to that retract position in absolute coordinates. The active axis is determined by GetUpperLowerAxisID() which reads pound variable #513.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if MDI command was issued successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.ThruFeedInBtn() for moving to the thru-feed in (zero) position
GrinderCenterlessGUIModule.GetUpperLowerAxisID() for active axis selection
Note
Documentation generated by AI on 2026-03-03

◆ ToggleMDI()

GrinderCenterlessGUIModule ToggleMDI ( )

Toggle the MDI input panel visibility with password protection.

Requires password level 1 authentication. When the MDI group is hidden (Left = "10000"), moves it to the visible position (Left = "105") and hides the G-code group. When the MDI group is visible, reverses the swap. Updates the MdiBtn label and background color to reflect the current display mode.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - false if password check fails
(string) Status message from w.FunctionError() on password failure, no return on success
Note
Password level 1 is required; if authentication fails a warning message is shown and the function returns early
Documentation generated by AI on 2026-03-03

◆ UpdateGrinderControls()

GrinderCenterlessGUIModule UpdateGrinderControls ( )

Update high-priority grinder UI controls for slide selection, position LEDs, and thru-feed state.

Refreshes the following UI elements on every PLC cycle:

  • Highlights UpperSlideBtn or LowerSlideBtn based on pound variable #513 (active axis selection)
  • Reads infeed retract setpoint from #506 and lights RetractLed GREEN when axis is at that position
  • Reads thru-feed retract from #507 and current axis position to color ThruFeedInBtn / ThruFeedOutBtn
  • Updates TotalUCompDRO, TotalYCompDRO, and TotalUpperLowerCompDRO from the TOTAL_COMP table
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if all updates completed successfully
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    Note
    Documentation generated by AI on 2026-03-03

◆ UpdateLowPriorityGrinderControls()

GrinderCenterlessGUIModule UpdateLowPriorityGrinderControls ( )

Update low-priority grinder UI controls including wheel buttons, counters, and comp labels.

Refreshes the following UI elements at a lower frequency than the main PLC loop:

  • Calls SetRegulatingWheelSpeed() to apply the current pound variable #516 speed setting
  • Updates RepeatToggleBtn color based on pound variable #538
  • Updates PassCounterDRO from pound variable #517 and PartCounterDRO from #540
  • Updates HydraulicsBtn color and label (3-stage: off / output-on / pressure-confirmed)
  • Monitors hydraulic pressure drop-out and stops regulating and grinding wheels if pressure is lost
  • Updates RegulatingWheelBtn color and RegWheelLED (3-stage: off / output-on / input-confirmed)
  • Updates GrindingWheelBtn color and GrindingWheelLED (3-stage: off / output-on / input-confirmed)
  • Updates Fine/Coarse comp button labels with current comp amounts from #509 and #508
  • Highlights the active upper/lower slide axis labels and home/zero buttons in green
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if all updates completed successfully
    (string) Status message from w.FunctionCompleted() or w.FunctionError()
    Warning
    Automatically calls StopRegulatingWheel() and StopGrindingWheel() if hydraulic pressure drops
    Note
    Documentation generated by AI on 2026-03-03

◆ UpdateStackLight()

GrinderCenterlessGUIModule UpdateStackLight ( )

Update the stack light outputs based on current machine alarm and run state.

Checks the LightStackEnabled OEM parameter before proceeding. If the light stack is disabled, returns early. Otherwise, evaluates the current GMS alarm and warning states as well as the machine run state (MACH_STATE) to determine the correct red and green light output states.

  • Alarm or Warning active: Red ON, Green OFF
  • Machine running (not IDLE): Red OFF, Green ON
  • Machine IDLE with no alarms: Red ON, Green OFF
    Returns
    (nil) No meaningful primary return value
    (boolean) Success flag - true if operation completed successfully
    (string) Status message from w.FunctionCompleted(), w.FunctionError(), or "Light Stack Disabled"
    Note
    Documentation generated by AI on 2026-03-03

◆ UpperSlideBtn()

GrinderCenterlessGUIModule UpperSlideBtn ( )

Select the upper slide axis as the active compensation axis.

Sets pound variable #513 to UPPER_SLIDE_AXIS_ID (mc.B_AXIS) to designate the upper slide as the active axis for all subsequent compensation and thru-feed operations. The UI button highlight update is handled by UpdateGrinderControls() on the next PLC cycle.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if pound variable was set successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.LowerSlideBtn() for selecting the lower slide axis
GrinderCenterlessGUIModule.GetUpperLowerAxisID() for reading the active axis selection
Note
Documentation generated by AI on 2026-03-03

◆ ZeroYOperatorPanelBtn()

GrinderCenterlessGUIModule ZeroYOperatorPanelBtn ( )

Zero the Y axis position at the current location via operator panel button.

Logs the zero action, updates stop status, and checks the ToolPathAutoRegen OEM parameter. If a user.UserZeroY hook is defined it is called instead of the default behavior. The default behavior sets the Y axis position to 0.0 using mc.mcAxisSetPos(). After zeroing, regenerates the tool path if ToolPathAutoRegen is "Yes" and saves the current fixture offsets.

Returns
(nil) No meaningful primary return value
(boolean) Success flag - true if Y axis was zeroed successfully
(string) Status message from w.FunctionCompleted() or w.FunctionError()
See also
GrinderCenterlessGUIModule.SaveFixtureOffsets() for the fixture offset save step
GrinderCenterlessGUIModule.RegenerateToolPathDialog() for tool path regeneration
Note
Documentation generated by AI on 2026-03-03