|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| GrinderCenterlessScreenV02 | InitializeTolerances () |
| Initialize all position tolerance values from imperial defaults converted to current units. | |
| GrinderCenterlessScreenV02 | IsRetracting () |
| Get the current retracting interlock state. | |
| GrinderCenterlessScreenV02 | SetRetracting (new_state) |
| Set the retracting interlock state and log the change. | |
| GrinderCenterlessScreenV02 | PreCycleStop () |
| Check pre-conditions before executing a cycle stop. | |
| GrinderCenterlessScreenV02 | MoveToRetractPosition (CustomMode) |
| Move the active slide to the retract position with reentrancy protection. | |
| GrinderCenterlessScreenV02 | MachineCycleStopFinal (CustomMode) |
| Perform the final cycle stop sequence for the Centerless Grinder. | |
| GrinderCenterlessScreenV02 | MachineScreenLoadScript () |
| Execute all machine-specific screen load initialization for the Centerless Grinder. | |
| GrinderCenterlessScreenV02 | MachineScreenStartupScript () |
| Execute all machine-specific startup tasks for the Centerless Grinder screen. | |
| GrinderCenterlessScreenV02 | ScreenIsLoadedScript () |
| Run all post-screen-load initialization tasks for the Centerless Grinder. | |
| GrinderCenterlessScreenV02 | MachineAutoLoadLastGCode () |
| Handle post-auto-load tab selection for multi-instance Centerless Grinder configurations. | |
| GrinderCenterlessScreenV02 | MachinePostAutoLoadLastGCode () |
| Restore the last saved operation tab after auto-loading the last G-code file. | |
| GrinderCenterlessScreenV02 | GetAxisLetterName (AxisID) |
| Get a multi-line display label for an axis based on the selected instance and axis ID. | |
| GrinderCenterlessScreenV02 | GetAxisShortName (AxisID, inst) |
| Get a short display name for an axis based on the selected instance and axis ID. | |
| GrinderCenterlessScreenV02 | InitializeGrindMode () |
| Initialize the active grind mode based on enabled features and the current operation tab. | |
| GrinderCenterlessScreenV02 | MachineScreenPLCScript () |
| Execute all real-time PLC cycle updates for the Centerless Grinder screen. | |
| GrinderCenterlessScreenV02 | LoadJobFileFinal () |
| Finalize loading a job file by writing pound variables to the tool table and updating UI. | |
| GrinderCenterlessScreenV02 | EnableFinal () |
| Perform post-enable initialization for the Centerless Grinder. | |
| GrinderCenterlessScreenV02 | MachineScreenLowPriorityLoop () |
| Execute all low-priority periodic updates for the Centerless Grinder screen. | |
| GrinderCenterlessScreenV02 | GetWheelAttributes () |
| Retrieve the wheel attributes table from the aux module. | |
| GrinderCenterlessScreenV02 | InitializeInFeedRates () |
| Initialize the In-Feed rates panel layout based on regulating wheel speed configuration. | |
| GrinderCenterlessScreenV02 | UpdateInFeedControls () |
| Update all In-Feed cycle position indicators, marquee LED, and axis position display. | |
| GrinderCenterlessScreenV02 | UpdatePartKicker () |
| Update the Part Kicker state machine and control outputs each PLC cycle. | |
| GrinderCenterlessScreenV02 | GetPartKickerMoveToLoadPositionGCode () |
| Generate the G-code string to move the Part Kicker OB Axis to the load position. | |
| GrinderCenterlessScreenV02 | PartKickerTeachPosition (PositionName) |
| Teach a Part Kicker OB Axis position by storing the current machine position. | |
| GrinderCenterlessScreenV02 | PartKickerMoveToPosition (PositionName) |
| Move the Part Kicker OB Axis to the specified named position via the axis jogger. | |
| GrinderCenterlessScreenV02 | IsPartKickerAtPosition (PositionName) |
| Check whether the Part Kicker OB Axis is at the specified named position. | |
| GrinderCenterlessScreenV02 | IsPartKickerEnabled () |
| Check whether the Part Kicker feature is enabled (cached). | |
| GrinderCenterlessScreenV02 | IsPartKickerTypeOBAxisEnabled () |
| Check whether the Part Kicker OB Axis type is enabled and configured. | |
| GrinderCenterlessScreenV02 | PartKickerManualCycle () |
| Trigger a manual kick cycle for the Part Kicker. | |
| GrinderCenterlessScreenV02 | PartKickerManualCycleRetract () |
| Trigger a manual retract cycle for the Part Kicker. | |
| GrinderCenterlessScreenV02 | IsPartKicker () |
| Check whether the Part Kicker output signal is currently active. | |
| GrinderCenterlessScreenV02 | PartLoaderRetractCycle () |
| Execute a part loader retract cycle via MDI or multi-instance subroutine. | |
| GrinderCenterlessScreenV02 | PartLoaderAlarmActive () |
| Create or update a GMS Alarm dialog when the part loader enters an alarmed state. | |
| GrinderCenterlessScreenV02 | PartLoaderNoticeMessageActive () |
| Create or update a GMS Notice dialog when the part loader sends a notice message. | |
| GrinderCenterlessScreenV02 | IsWheelsInPositionPartLoader () |
| Check whether both the main slide and secondary slide are in position for the part loader. | |
| GrinderCenterlessScreenV02 | SetPartLoaderGripperToLowerSlideOffset () |
| Teach and store the gripper-to-lower-slide offset for the part loader. | |
| GrinderCenterlessScreenV02 | UpdatePartLoader () |
| Update the part loader interlock outputs and motion inhibit signals. | |
| GrinderCenterlessScreenV02 | IsPartLoaderReady () |
| Validate all preconditions required before running a part loader cycle. | |
| GrinderCenterlessScreenV02 | PartLoaderMachineEmpty () |
| Set pound variable #9065 to zero when the machine is idle, marking it as empty. | |
| GrinderCenterlessScreenV02 | PartLoaderIsMachineEmpty () |
| Check whether the machine is currently empty (no part loaded). | |
| GrinderCenterlessScreenV02 | PartLoaderLoad () |
| Initiate a part loader load cycle when the machine is idle and loader is ready. | |
| GrinderCenterlessScreenV02 | IsPartLoaderLoad () |
| Check whether the part loader is currently executing a load cycle. | |
| GrinderCenterlessScreenV02 | PartLoaderUnload () |
| Initiate a part loader unload cycle when the machine is idle and loader is ready. | |
| GrinderCenterlessScreenV02 | IsPartLoaderUnload () |
| Check whether the part loader is currently executing an unload cycle. | |
| GrinderCenterlessScreenV02 | UpdateThruFeedControls () |
| Update the Thru-Feed grind cycle position indicators and marquee LED. | |
| GrinderCenterlessScreenV02 | MarqueeObject (marquee) |
| Animate a marquee indicator LED object to track axis position between two machine coordinates. | |
| GrinderCenterlessScreenV02 | IsAtThruFeedRetractPosition () |
| Check whether the upper/lower slide axis is at the Thru-Feed retract position. | |
| GrinderCenterlessScreenV02 | IsAtThruFeedGrindPosition () |
| Check whether the upper/lower slide axis is at the Thru-Feed grind position. | |
| GrinderCenterlessScreenV02 | TouchOffTeachY () |
| Teach the Y-axis touch-off position by reading the current machine position. | |
| GrinderCenterlessScreenV02 | TouchOffTeachZ () |
| Teach the Z-axis touch-off position by reading the current machine position. | |
| GrinderCenterlessScreenV02 | ExecuteCalibrationBtn () |
| Execute tool calibration using taught touch-off positions and measured part dimensions. | |
| GrinderCenterlessScreenV02 | MoveToCycleStopRetractPosition (Operation) |
| Perform a protected cycle stop retract sequence. | |
| GrinderCenterlessScreenV02 | MoveToEmergencyRetractPosition () |
| Perform a protected emergency retract move sequence. | |
| GrinderCenterlessScreenV02 | MoveToLoadPosition (infeed_load_pos) |
| Move the active slide axis and optional secondary slide to the load or retract position. | |
| GrinderCenterlessScreenV02 | IsAtLoadPosition () |
| Check whether both the main slide and secondary slide are at their load positions. | |
| GrinderCenterlessScreenV02 | RestoreLastRunTabIndex () |
| Restore the last saved operation tab index and set the active tab. | |
| GrinderCenterlessScreenV02 | SaveCurrentRunTabIndex (tab) |
| Save the current operation tab index to the machine profile. | |
| GrinderCenterlessScreenV02 | ScreenTabEnter (tab) |
| Handle tab enter events for the Centerless Grinder operation and service tabs. | |
| GrinderCenterlessScreenV02 | ScreenTabExit (tab) |
| Handle tab exit events for the Centerless Grinder operation tabs. | |
| GrinderCenterlessScreenV02 | InitializeToolTableFields () |
| Initialize or update the tool table user field definitions for Centerless Grinder wheel attributes. | |
| GrinderCenterlessScreenV02 CYCLE | Initialize () |
| Initialize the CYCLE state machine for the Centerless Grinder screen. | |
| cyc | UpdateCombLabels (dressing_passes, _type, type_passes) |
| Update all combined cycle label objects with the current state and type descriptions. | |
| cyc STATE | GetNumber () |
| Get the current cycle state number from the configured pound variable. | |
| GrinderCenterlessScreenV02 | GetAxisPositionGroupTable () |
| Return the axis position group layout configuration table for the current screen state. | |
| GrinderCenterlessScreenV02 | ShowHideSpindleGroup (groupname, showhide) |
| Hide a spindle group UI element by name (unconditionally). | |
| GrinderCenterlessScreenV02 | DressInterrupt () |
| Trigger a dress interrupt to cause the running program to perform a dress cycle. | |
| GrinderCenterlessScreenV02 | IsDressInterruptActive () |
| Check whether the dress interrupt is currently active. | |
| GrinderCenterlessScreenV02 | MachineCycleStartFinal () |
| Validate state and dispatch to the correct cycle start handler based on the active operation tab. | |
| GrinderCenterlessScreenV02 | CycleStartMainProgramOnly () |
| Start the main G-code program from instance 0 only when in a valid state. | |
| GrinderCenterlessScreenV02 | EmergencyRetract () |
| Perform a full emergency retract sequence with reentrancy protection. | |
| GrinderCenterlessScreenV02 | RunGrindWheelDressCycle (ignore_confirmation) |
| Initiate a Grind Wheel dress cycle with optional confirmation dialog. | |
| GrinderCenterlessScreenV02 | RunRegulatingWheelDressCycle (ignore_confirmation) |
| Initiate a Regulating Wheel dress cycle with optional confirmation dialog. | |
| GrinderCenterlessScreenV02 | EndOfProgram () |
| Handle end-of-program cleanup for the Centerless Grinder. | |
| GrinderCenterlessScreenV02 | ClearIsWheelInDressCycleFlags () |
| Clear both wheel dress cycle flags. | |
| GrinderCenterlessScreenV02 | SetIsGrindWheelInDressCycleFlag () |
| Set the flag indicating the Grind Wheel is currently in a dress cycle. | |
| GrinderCenterlessScreenV02 | SetIsRegWheelInDressCycleFlag () |
| Set the flag indicating the Regulating Wheel is currently in a dress cycle. | |
| GrinderCenterlessScreenV02 | SetGrinderOperationNumber (OperationNumber) |
| Set the active grinder operation number in Mach4 pound variable #546. | |
| GrinderCenterlessScreenV02 | MachineDisable () |
| Reset machine state flags and set the cycle to idle on machine disable. | |
| GrinderCenterlessScreenV02 | IsGrindPositionSet () |
| Check whether the grind position has been calibrated. | |
| GrinderCenterlessScreenV02 | UpdateGrindPositionSetIndicator () |
| Update the grind position calibration indicator LEDs and labels on screen. | |
| GrinderCenterlessScreenV02 | SetGrindPositionSetIndicator () |
| Set the grind position calibrated flag in the machine profile. | |
| GrinderCenterlessScreenV02 | ReSetGrindPositionSetIndicator () |
| Clear the grind position calibrated flag in the machine profile. | |
| GrinderCenterlessScreenV02 | SetGrindPosition () |
| Set the grind finish position by prompting the operator for a new value. | |
| GrinderCenterlessScreenV02 | EditModeControlOn () |
| Activate the Edit Mode button highlight for grind position set buttons. | |
| GrinderCenterlessScreenV02 | EditModeControlOff () |
| Deactivate the Edit Mode button highlight for grind position set buttons. | |
| GrinderCenterlessScreenV02 | IsEditModeActive () |
| Check whether Edit Mode is currently active based on button background color. | |
| GrinderCenterlessScreenV02 | ShowInScreenGCodeEditor () |
| Show the in-screen G-code editor and hide the standard tool path display. | |
| GrinderCenterlessScreenV02 | HideInScreenGCodeEditor () |
| Hide the in-screen G-code editor and restore the standard tool path display. | |
| GrinderCenterlessScreenV02 | IsGCodeDisplayExtraLargeEnabled () |
| Check whether the extra-large G-code display mode is enabled for this screen. | |
| GrinderCenterlessScreenV02 | GetSmallToolPathGroupHeight () |
| Return the fixed height value for the small tool path group UI element. | |
| GrinderCenterlessScreenV02 | GetSmallToolPathGroupBgImageName () |
| Return the background image name for the small tool path group. | |
| GrinderCenterlessScreenV02 | GetSmallToolPathPanelHeight () |
| Return the fixed height value for the small tool path panel UI element. | |
| GrinderCenterlessScreenV02 | GetLargeToolPathGroupHeight () |
| Return the fixed height value for the large tool path group UI element. | |
| GrinderCenterlessScreenV02 | GetLargeToolPathGroupBgImageName () |
| Return the background image name for the large tool path group. | |
| GrinderCenterlessScreenV02 | GetLargeToolPathPanelHeight () |
| Return the fixed height value for the large tool path panel UI element. | |
| GrinderCenterlessScreenV02 | EditModeGroupsButtons (Value) |
| Enable or disable groups of edit-mode controls under the Fixture Offsets tab. | |
| GrinderCenterlessScreenV02 | GetEditModeButtonText () |
| Return the localized label text for the Edit Mode button. | |
| GrinderCenterlessScreenV02 | InitializeCenterlessGrinder () |
| Initialize all Centerless Grinder-specific screen objects and UI state. | |
| GrinderCenterlessScreenV02 | InitializeSignalScript () |
| Initialize the signal script handler table for all configured Mach4 instances. | |
| GrinderCenterlessScreenV02 | DROToToolTable (dro_names, value) |
| Write a DRO value to the tool table user field corresponding to the DRO name. | |
| GrinderCenterlessScreenV02 | UpdateWheelSpeedModeButtons () |
| Update the RPM/SFM mode toggle button highlight colors for both wheel speed panels. | |
| GrinderCenterlessScreenV02 | WheelSpeedModeRPMBtn () |
| Set the Grind Wheel speed mode to RPM and refresh dependent UI. | |
| GrinderCenterlessScreenV02 | WheelSpeedModeSFMBtn () |
| Set the Grind Wheel speed mode to SFM and refresh dependent UI. | |
| GrinderCenterlessScreenV02 | RegWheelSpeedModeRPMBtn () |
| Set the Regulating Wheel speed mode to RPM and refresh dependent UI. | |
| GrinderCenterlessScreenV02 | RegWheelSpeedModeSFMBtn () |
| Set the Regulating Wheel speed mode to SFM and refresh dependent UI. | |
| GrinderCenterlessScreenV02 LayoutObjects | new (grid_objects) |
| Create a new LayoutObjects grid instance from a configuration table. | |
| GrinderCenterlessScreenV02 LayoutObjects | layout () |
| Lay out all visible objects in the LayoutObjects grid. | |
| GrinderCenterlessScreenV02 LayoutObjects | hidden (value) |
| Set the hidden state of a named row in the LayoutObjects grid. | |
| GrinderCenterlessScreenV02 | InitializeGrindDress () |
| Initialize and layout the Grind Wheel dressing controls panel. | |
| GrinderCenterlessScreenV02 | InitializeRegulatingDress () |
| Initialize and layout the Regulating Wheel dressing controls panel. | |
| GrinderCenterlessScreenV02 | ResetTotalCompBtn (AxisID) |
| Reset the total compensation accumulator for the specified axis. | |
| GrinderCenterlessScreenV02 | UpdatePartCounters () |
| Update background colors of part counter DRO objects based on their values. | |
| GrinderCenterlessScreenV02 | InitializeThruFeedPartCounter () |
| Initialize the Thru-Feed part counter signal handler and persistent I/O points. | |
| GrinderCenterlessScreenV02 | UpdateThruFeedPartCounter () |
| Increment the Thru-Feed part counters and trigger dress-required notifications. | |
| GrinderCenterlessScreenV02 | IsThruFeedPartCounterEnabled () |
| Check whether the Thru-Feed part counter feature is enabled. | |
| GrinderCenterlessScreenV02 | ResetPartCounterBtn () |
| Stub handler for the Reset Part Counter button. | |
| GrinderCenterlessScreenV02 | ResetUpperLowerTotalCompBtn () |
| Reset the total compensation accumulator for the active upper/lower slide axis. | |
| GrinderCenterlessScreenV02 | ResetExtraUpperLowerCompBtn () |
| Reset the Extra Comp Amount OEM parameter to zero. | |
| GrinderCenterlessScreenV02 | CompSlideBtn (Direction, Amount,...) |
| Apply a compensation adjustment to the active slide axis (button handler variant). | |
| GrinderCenterlessScreenV02 | CompSlide (Direction, Amount) |
| Apply a compensation adjustment to the active slide axis based on the current grind mode. | |
| GrinderCenterlessScreenV02 | ThruFeedCompMainGrindAxis (Direction, Amount) |
| Apply a compensation adjustment to the main grind axis for Thru-Feed mode. | |
| GrinderCenterlessScreenV02 | CompMainGrindAxis (Type, Direction, Amount) |
| Apply a compensation adjustment to the main grind axis (upper/lower slide). | |
| GrinderCenterlessScreenV02 | Comp (AxisID, Type, Direction, Amount) |
| Apply a compensation adjustment to a grinder axis using the specified compensation type. | |
| GrinderCenterlessScreenV02 | IsGrindWheelEnabled () |
| Check whether the Grind Wheel is enabled. | |
| GrinderCenterlessScreenV02 | IsRegulatingWheelEnabled () |
| Check whether the Regulating Wheel is enabled. | |
| GrinderCenterlessScreenV02 | IsHydraulicsEnabled () |
| Check whether the hydraulics system is enabled. | |
| GrinderCenterlessScreenV02 | IsInFeedModeActive () |
| Check whether In-Feed grind mode is currently active. | |
| GrinderCenterlessScreenV02 | IsThruFeedModeActive () |
| Check whether Thru-Feed grind mode is currently active. | |
| GrinderCenterlessScreenV02 | ThruFeedInBtn () |
| Handle the Thru-Feed In button press to move to the grind position. | |
| GrinderCenterlessScreenV02 | GoToThruFeedGrindPosition (use_confirmation) |
| Move the active slide axis to the Thru-Feed grind position via MDI. | |
| GrinderCenterlessScreenV02 | ThruFeedOutBtn () |
| Handle the Thru-Feed Out button press to move to the retract position. | |
| GrinderCenterlessScreenV02 | GoToThruFeedRetractPosition (use_confirmation) |
| Move the active slide axis to the Thru-Feed retract position via MDI. | |
| GrinderCenterlessScreenV02 | UpperSlideBtn () |
| Select the Upper Slide as the active upper/lower axis and refresh the axis position group. | |
| GrinderCenterlessScreenV02 | LowerSlideBtn () |
| Select the Lower Slide as the active upper/lower axis and refresh the axis position group. | |
| GrinderCenterlessScreenV02 | IsDisableWheelsStartingAutomaticallyOn () |
| Check whether the "Disable Wheels Starting Automatically" feature is enabled. | |
| GrinderCenterlessScreenV02 | IsInterlockThatForcesRegulatingWheelToBeOnBeforeTheGrindinWheelOn () |
| Check whether the interlock requiring the Regulating Wheel to be on before the Grind Wheel is active. | |
| GrinderCenterlessScreenV02 | IsInFeedCycleRepeatOn () |
| Check whether the In-Feed cycle repeat feature is currently enabled. | |
| GrinderCenterlessScreenV02 | InFeedCycleRepeatOn () |
| Enable the In-Feed cycle repeat feature. | |
| GrinderCenterlessScreenV02 | InFeedCycleRepeatOff () |
| Disable the In-Feed cycle repeat feature. | |
| GrinderCenterlessScreenV02 | InFeedCycleRepeatToggle () |
| Toggle the In-Feed cycle repeat setting on or off. | |
| GrinderCenterlessScreenV02 | IsGrindWheelDressing () |
| Check whether the Grind Wheel is currently in a dress cycle. | |
| GrinderCenterlessScreenV02 | IsRegulatingWheelDressing () |
| Check whether the Regulating Wheel is currently in a dress cycle. | |
| GrinderCenterlessScreenV02 | IsGrindWheelDressingEnabled () |
| Check whether Grind Wheel dressing is enabled in OEM parameters. | |
| GrinderCenterlessScreenV02 | IsRegulatingWheelDressingEnabled () |
| Check whether Regulating Wheel dressing is enabled in OEM parameters. | |
| GrinderCenterlessScreenV02 | UpdateLowPriorityGrinderControls () |
| Update all low-priority grinder screen controls and indicators. | |
| GrinderCenterlessScreenV02 | GrindDressTeachDiamondOperatorPanelBtn (diamond_traverse) |
| Teach the Grind Wheel dresser diamond or traverse position from the operator panel. | |
| GrinderCenterlessScreenV02 | RegDressTeachDiamondOperatorPanelBtn (diamond_traverse) |
| Teach the Regulating Wheel dresser diamond or traverse position from the operator panel. | |
| GrinderCenterlessScreenV02 | GrindDressCompDiamondOperatorPanelBtn (diamond_traverse, Direction, Amount) |
| Apply a compensation adjustment to a Grind Wheel dresser axis from the operator panel. | |
| GrinderCenterlessScreenV02 | RegDressCompDiamondOperatorPanelBtn (diamond_traverse, Direction, Amount) |
| Apply a compensation adjustment to a Regulating Wheel dresser axis from the operator panel. | |
| GrinderCenterlessScreenV02 | GWCustomDressProfileBtn () |
| Toggle the Grind Wheel custom dress profile program on or off. | |
| GrinderCenterlessScreenV02 | StoreLastGrindDressCustomProgram (SubNumber) |
| Store the last used Grind Wheel custom dress program number to the machine profile. | |
| GrinderCenterlessScreenV02 | UpdateGWCustomDressProfile () |
| Update the Grind Wheel custom dress profile button and group visibility. | |
| GrinderCenterlessScreenV02 | RWCustomDressProfileBtn () |
| Toggle the Regulating Wheel custom dress profile program on or off. | |
| GrinderCenterlessScreenV02 | StoreLastRegDressCustomProgram (SubNumber) |
| Store the last used Regulating Wheel custom dress program number to the machine profile. | |
| GrinderCenterlessScreenV02 | UpdateRWCustomDressProfile () |
| Update the Regulating Wheel custom dress profile button and group visibility. | |
| GrinderCenterlessScreenV02 | OpenDressProfiler (dresser_type, sub_number) |
| Open the Profile Dressing wizard for editing or creating a dress profile. | |
| ProfileDressing | OnDestroy () |
| Callback invoked when the Profile Dressing wizard window is destroyed. | |
| GrinderCenterlessScreenV02 | NewDressProgramBtn (dresser_type) |
| Open the Profile Dressing wizard to create a new dress profile program. | |
| GrinderCenterlessScreenV02 | OpenDressProgramBtn (dresser_type) |
| Open a file dialog to select and load an existing custom dress profile program. | |
| GrinderCenterlessScreenV02 | EditDressProgramBtn (dresser_type) |
| Open the Profile Dressing editor for the currently active custom dress program. | |
| GrinderCenterlessScreenV02 | ReloadDressProgramBtn () |
| Reload the currently selected dress program from disk. | |
| GrinderCenterlessScreenV02 | IsRegulatingWheelSpeedsInCycleOn () |
| Check whether the Regulating Wheel Speeds in Cycle feature is enabled. | |
| GrinderCenterlessScreenV02 | RegulatingWheelSpeedsInCycleOn () |
| Enable the Regulating Wheel Speeds in Cycle feature. | |
| GrinderCenterlessScreenV02 | RegulatingWheelSpeedsInCycleOff () |
| Disable the Regulating Wheel Speeds in Cycle feature. | |
| GrinderCenterlessScreenV02 | RegulatingWheelSpeedsInCycleToggle () |
| Toggle the Regulating Wheel Speeds in Cycle setting on or off. | |
| GrinderCenterlessScreenV02 | InitializeOperatorPanels () |
| Configure operator panel button mappings specific to the Centerless Grinder. | |
| GrinderCenterlessScreenV02 | GetFileGroupBottomPosition () |
| Return the fixed bottom position value for the file group UI element. | |
| GrinderCenterlessScreenV02 | ValidateInFeedCycleData () |
| Validate all In-Feed cycle data against required business rules. | |
| GrinderCenterlessScreenV02 | ValidateThruFeedCycleData () |
| Validate all Thru-Feed cycle data against required business rules. | |
| GrinderCenterlessScreenV02 | ValidateCycleDataList (datatable) |
| Validate a list of cycle data pound variables against their business rules. | |
| GrinderCenterlessScreenV02 | ValidateDROValue (value, name) |
| Validate a DRO value string and return the corrected value as a string. | |
| GrinderCenterlessScreenV02 | ValidateCycleData (value, name) |
| Validate a single cycle data value against business rules for the given field name. | |
| GrinderCenterlessScreenV02 | MachineCreatePreCannedCommands () |
| Register all pre-canned commands available for the Centerless Grinder screen. | |
| GrinderCenterlessScreenV02 | UpdateSpindleMinMaxSpeed () |
| Stub function that disables spindle min/max speed updates for this screen. | |
| GrinderCenterlessScreenV02 | UpdateMPGAxisSelector () |
| Stub function that disables MPG axis selector updates for this screen. | |
| GrinderCenterlessScreenV02 ClearIsWheelInDressCycleFlags | ( | ) |
Clear both wheel dress cycle flags.
Sets both IsRegWheelDressCycle and IsGrindWheelDressCycle screen-level flags to false, indicating that neither wheel is currently in a dress cycle.
| GrinderCenterlessScreenV02 Comp | ( | AxisID | , |
| Type | , | ||
| Direction | , | ||
| Amount | ) |
Apply a compensation adjustment to a grinder axis using the specified compensation type.
Supports four compensation types:
Fine and Coarse step amounts are read from pound variables #591 and #590 respectively. After compensation, updates the per-axis and total comp amount OEM registers. For Type 2 in Thru-Feed mode, an optional backlash move can be applied when moving away from the part.
| AxisID | (number) The Mach4 axis ID to compensate (mc.X_AXIS through mc.MC_MAX_COORD_AXES) |
| Type | (number) Compensation type: 1 (offset only), 2 (offset + move), 3 (dresser comp), 4 (extra comp next cycle) |
| Direction | (number) Compensation direction: 1 (out/positive) or -1 (in/negative) |
| Amount | (string) Step size: "Fine" (reads #591) or "Coarse" (reads #590) |
| GrinderCenterlessScreenV02 CompMainGrindAxis | ( | Type | , |
| Direction | , | ||
| Amount | ) |
Apply a compensation adjustment to the main grind axis (upper/lower slide).
Retrieves the active upper/lower axis ID via aux.GetUpperLowerAxisID() and delegates to Comp() with the provided Type, Direction, and Amount arguments.
| Type | (number) Compensation type passed to Comp(): 1 (offset), 2 (offset + move), 3 (dresser), 4 (extra) |
| Direction | (number) Compensation direction: 1 (out) or -1 (in) |
| Amount | (string) Step size: "Fine" or "Coarse" |
| GrinderCenterlessScreenV02 CompSlide | ( | Direction | , |
| Amount | ) |
Apply a compensation adjustment to the active slide axis based on the current grind mode.
Delegates to ThruFeedCompMainGrindAxis() when Thru-Feed mode is active, or to CompMainGrindAxis() with Type 4 (extra comp on next cycle) when In-Feed mode is active.
| Direction | (number) Compensation direction: 1 (out) or -1 (in) |
| Amount | (string) Step size: "Fine" or "Coarse" |
| GrinderCenterlessScreenV02 CompSlideBtn | ( | Direction | , |
| Amount | , | ||
| ... ) |
Apply a compensation adjustment to the active slide axis (button handler variant).
Calls _CompSlide() with the provided Direction and Amount. This is the button-triggered entry point; additional variadic arguments are accepted but ignored.
| Direction | (number) Compensation direction: 1 (out) or -1 (in) |
| Amount | (string) Step size: "Fine" or "Coarse" |
| ... | (any) Additional arguments accepted but ignored |
| GrinderCenterlessScreenV02 CycleStartMainProgramOnly | ( | ) |
Start the main G-code program from instance 0 only when in a valid state.
Checks that instance 0 is not already in FRUN or MRUN state before calling mc.mcCntlCycleStart(). After starting, checks for macro hold states and releases the file hold if needed. Updates the cycle start timestamp for instance 0.
| GrinderCenterlessScreenV02 DressInterrupt | ( | ) |
Trigger a dress interrupt to cause the running program to perform a dress cycle.
Sets pound variable #998 to 1 only when the machine state (MACH_STATE) is between 100 and 199 (inclusive), which corresponds to active grinding states. The G-code program monitors this variable to initiate a dress cycle at the next opportunity.
| GrinderCenterlessScreenV02 DROToToolTable | ( | dro_names | , |
| value | ) |
Write a DRO value to the tool table user field corresponding to the DRO name.
Strips the instance suffix from the DRO object name (e.g., removes "DRO(1)" suffix) to derive the tool table field name, then writes the numeric value to that field via w.SetToolTableUserValue(). Returns early without action if value is nil.
| dro_names | (string) The DRO object name, potentially including an instance suffix (e.g., "WheelDiameter_1DRO(1)") |
| value | (number|nil) The value to write to the tool table field. If nil, the function returns immediately |
| GrinderCenterlessScreenV02 EditDressProgramBtn | ( | dresser_type | ) |
Open the Profile Dressing editor for the currently active custom dress program.
Reads the active custom dress subroutine number from pound variable #518 (Grind Wheel) or #519 (Regulating Wheel) depending on dresser_type, then opens the Profile Dressing wizard via OpenDressProfiler() for that subroutine number.
| dresser_type | (string) The dresser to edit: "GrindWheel" or "RegWheel" |
| GrinderCenterlessScreenV02 EditModeControlOff | ( | ) |
Deactivate the Edit Mode button highlight for grind position set buttons.
Sets the background color of "SetInFeedGrindPositionBtn" and "SetThruFeedGrindPositionBtn" (when they exist on screen) back to the standard button off color (m.screen.ColorScheme.Button.Off.Bg), visually indicating that Edit Mode is no longer active.
| GrinderCenterlessScreenV02 EditModeControlOn | ( | ) |
Activate the Edit Mode button highlight for grind position set buttons.
Sets the background color of "SetInFeedGrindPositionBtn" and "SetThruFeedGrindPositionBtn" (when they exist on screen) to the standard yellow color (m.screen.ColorScheme.Standard.Yellow), visually indicating that Edit Mode is active.
| GrinderCenterlessScreenV02 EditModeGroupsButtons | ( | Value | ) |
Enable or disable groups of edit-mode controls under the Fixture Offsets tab.
Retrieves all child groups of "FixtureOffsetsTab(1)" (excluding "EditModeGroup") and sets their "Enabled" property to the provided Value string for each group found.
| Value | (string) The enabled state to set: "1" to enable, "0" to disable |
| GrinderCenterlessScreenV02 EmergencyRetract | ( | ) |
Perform a full emergency retract sequence with reentrancy protection.
Uses w.FuncTracing to prevent multiple simultaneous emergency retract sequences. If already in progress, returns immediately. Otherwise, sets the tracing flag, calls _EmergencyRetract() via w.pcall() for error protection, clears the flag, and propagates the result. The inner _EmergencyRetract() stops all instances, moves to retract position, triggers part kicker retract, runs part loader retract, optionally stops all wheels, and runs pre/post emergency retract hooks.
| GrinderCenterlessScreenV02 EnableFinal | ( | ) |
Perform post-enable initialization for the Centerless Grinder.
Reads the "HydraulicsStartWithMachineEnable" OEM parameter. If set to "Yes", automatically starts the hydraulics system (without requiring operator confirmation) by calling StartHydraulics(false). Called when the machine is enabled.
| GrinderCenterlessScreenV02 EndOfProgram | ( | ) |
Handle end-of-program cleanup for the Centerless Grinder.
Clears both wheel dress cycle flags via ClearIsWheelInDressCycleFlags() when the G-code program reaches its end.
| GrinderCenterlessScreenV02 ExecuteCalibrationBtn | ( | ) |
Execute tool calibration using taught touch-off positions and measured part dimensions.
Reads the measured X and Z values from the MeasuredXDRO and MeasuredZDRO screen objects, and the taught machine positions from XTouchOffDRO and ZTouchOffDRO. Validates that at least one touch-off position has been taught. Computes new X tool offset accounting for diameter mode and tool slide direction, and new Z tool offset from the Z work offset. Writes the computed offsets to the tool table via mc.mcToolSetData() (clearing wear offsets), then activates the tool with an MDI T command. Resets the touch-off DRO values to zero after completion.
| GrinderCenterlessScreenV02 GetAxisLetterName | ( | AxisID | ) |
Get a multi-line display label for an axis based on the selected instance and axis ID.
Returns a two-line string identifying the axis for use in axis position group headers. When a secondary instance (_inst > 0) is selected, formats the label as the instance number on the first line and the standard axis letter in parentheses on the second line (e.g., "1\n(X)"). When the primary instance (instance 0) is selected, returns descriptive labels specific to the Centerless Grinder:
| AxisID | (number) The Mach4 axis ID constant (e.g., mc.X_AXIS, mc.B_AXIS) |
| GrinderCenterlessScreenV02 GetAxisPositionGroupTable | ( | ) |
Return the axis position group layout configuration table for the current screen state.
If user.GetAxisPositionGroupTable is defined, delegates to it and returns the result. Otherwise, builds a distribution parameters table containing all currently enabled and shown axes. The returned table specifies:
| GrinderCenterlessScreenV02 GetAxisShortName | ( | AxisID | , |
| inst | ) |
Get a short display name for an axis based on the selected instance and axis ID.
Returns a compact string identifying the axis for use in DRO labels and axis position groups. When a secondary instance (_inst > 0) is selected, formats the name as the instance number followed by the standard axis letter (e.g., "1X", "2Y"). When the primary instance (instance 0) is selected, returns descriptive names specific to the Centerless Grinder:
| AxisID | (number) The Mach4 axis ID constant (e.g., mc.X_AXIS, mc.B_AXIS) |
| inst | (number) The Mach4 instance handle (accepted but overridden internally) |
| GrinderCenterlessScreenV02 GetEditModeButtonText | ( | ) |
Return the localized label text for the Edit Mode button.
Returns the translated string "Set Grind\nPosition" for use as the Edit Mode button label.
| GrinderCenterlessScreenV02 GetFileGroupBottomPosition | ( | ) |
Return the fixed bottom position value for the file group UI element.
| GrinderCenterlessScreenV02 GetLargeToolPathGroupBgImageName | ( | ) |
Return the background image name for the large tool path group.
| GrinderCenterlessScreenV02 GetLargeToolPathGroupHeight | ( | ) |
Return the fixed height value for the large tool path group UI element.
| GrinderCenterlessScreenV02 GetLargeToolPathPanelHeight | ( | ) |
Return the fixed height value for the large tool path panel UI element.
| cyc PASSES GetNumber | ( | ) |
Get the current cycle state number from the configured pound variable.
Get the current remaining dressing passes count from pound variable 9082.
Get the current number of remaining passes from pound variable #9082.
Get the current number of remaining dressing passes from pound variable #9082.
Reads the pound variable specified by self.PoundVar (default #9080) via a w.pcall-protected w.api call. Returns 0 if the read fails or the value cannot be converted to a number, otherwise returns the current state number.
Reads pound variable #9082 via w.pcall-protected w.api call. Returns 0 if the read fails, otherwise returns the current pass count as a number.
Reads the passes pound variable using a protected call. Returns 0 if the call fails. This method is a member of the cyc.PASSES table object.
Uses w.pcall() to safely call w.api('mcCntlGetPoundVar') with pound variable 9082. If the call fails for any reason, returns 0 as a safe default. Otherwise returns the current pass count value.
| GrinderCenterlessScreenV02 GetPartKickerMoveToLoadPositionGCode | ( | ) |
Generate the G-code string to move the Part Kicker OB Axis to the load position.
When the OB Axis part kicker type is enabled, reads the load position from pound variable #9068 and constructs a two-line G-code string using M246 commands to select the OB axis and move it to the load position at the configured feedrate. Returns an empty string when the OB axis type is not enabled.
| GrinderCenterlessScreenV02 GetSmallToolPathGroupBgImageName | ( | ) |
Return the background image name for the small tool path group.
| GrinderCenterlessScreenV02 GetSmallToolPathGroupHeight | ( | ) |
Return the fixed height value for the small tool path group UI element.
| GrinderCenterlessScreenV02 GetSmallToolPathPanelHeight | ( | ) |
Return the fixed height value for the small tool path panel UI element.
| GrinderCenterlessScreenV02 GetWheelAttributes | ( | ) |
Retrieve the wheel attributes table from the aux module.
Delegates to aux.GetWheelAttributes() to obtain the full list of wheel parameter field definitions used for mapping between tool table fields and pound variables.
| GrinderCenterlessScreenV02 GoToThruFeedGrindPosition | ( | use_confirmation | ) |
Move the active slide axis to the Thru-Feed grind position via MDI.
Optionally shows a Cycle Start confirmation dialog before issuing the motion command. Reads the grind (finish) position from pound variable #516 and executes a G90 G00 MDI move to that position using the current upper/lower axis letter.
| use_confirmation | (boolean) If true, shows a confirmation dialog before moving |
| GrinderCenterlessScreenV02 GoToThruFeedRetractPosition | ( | use_confirmation | ) |
Move the active slide axis to the Thru-Feed retract position via MDI.
Optionally shows a Cycle Start confirmation dialog before issuing the motion command. Reads the retract position from pound variable #512 and executes a G90 G00 MDI move to that position using the current upper/lower axis letter.
| use_confirmation | (boolean) If true, shows a confirmation dialog before moving |
| GrinderCenterlessScreenV02 GrindDressCompDiamondOperatorPanelBtn | ( | diamond_traverse | , |
| Direction | , | ||
| Amount | ) |
Apply a compensation adjustment to a Grind Wheel dresser axis from the operator panel.
Logs the operator action, validates that the machine is enabled, then dispatches to Comp() with Type 3 (dresser compensation) for the appropriate axis based on diamond_traverse: "Diamond" maps to Y_AXIS, "Traverse" maps to X_AXIS. Defaults Direction to 1 and Amount to "Fine" if not provided.
| diamond_traverse | (string) The dresser component to compensate: "Diamond" or "Traverse" |
| Direction | (number|nil) Compensation direction: 1 (out) or -1 (in). Defaults to 1 if nil |
| Amount | (string|nil) Compensation step size: "Fine" or "Coarse". Defaults to "Fine" if nil |
| GrinderCenterlessScreenV02 GrindDressTeachDiamondOperatorPanelBtn | ( | diamond_traverse | ) |
Teach the Grind Wheel dresser diamond or traverse position from the operator panel.
Logs the operator action and validates that the machine is enabled and the Grind Wheel tab is currently active. If "Diamond" is selected, teaches the "2DressPosition_1" field and then moves Y axis to home (Y0.0). If "Traverse" is selected, teaches the "1DressPosition_1" field without a subsequent move.
| diamond_traverse | (string) The dresser component to teach: "Diamond" or "Traverse" |
| GrinderCenterlessScreenV02 GWCustomDressProfileBtn | ( | ) |
Toggle the Grind Wheel custom dress profile program on or off.
Reads the current grind wheel custom dress subroutine number from pound variable #518. If the subroutine number is non-zero, stores it via StoreLastGrindDressCustomProgram() and then clears #518 to zero (disabling the custom profile). If zero, reads the last stored program number from the machine profile and writes it to #518 (enabling the custom profile). Updates the grind wheel custom dress profile UI via UpdateGWCustomDressProfile() afterwards.
| GrinderCenterlessScreenV02 LayoutObjects hidden | ( | value | ) |
Set the hidden state of a named row in the LayoutObjects grid.
Searches the ObjectsInRows array for an entry whose "Name" key matches the provided name string, and sets its "Hidden" field to the specified value. Only the first matching entry is updated; the loop exits immediately after the match.
| name | (string) The row name to search for (matched against ObjectsInRows[i]["Name"]) |
| value | (boolean) The hidden state to assign: true to hide the row, false to show it |
| GrinderCenterlessScreenV02 HideInScreenGCodeEditor | ( | ) |
Hide the in-screen G-code editor and restore the standard tool path display.
Moves the GCodeEditor off-screen by setting its Left position to 10000, then restores the ToolDisplayGroup and ModalsGroup to visible, and calls SetGCodeDisplayToLastSize() to restore the tool path panel to its previous dimensions.
| GrinderCenterlessScreenV02 InFeedCycleRepeatOff | ( | ) |
Disable the In-Feed cycle repeat feature.
Sets Mach4 parameter 1920 to 0 to disable automatic cycle repeat for the In-Feed grind cycle.
| GrinderCenterlessScreenV02 InFeedCycleRepeatOn | ( | ) |
Enable the In-Feed cycle repeat feature.
Sets Mach4 parameter 1920 to 1 to enable automatic cycle repeat for the In-Feed grind cycle.
| GrinderCenterlessScreenV02 InFeedCycleRepeatToggle | ( | ) |
Toggle the In-Feed cycle repeat setting on or off.
Checks the current repeat state via IsInFeedCycleRepeatOn() and calls either InFeedCycleRepeatOff() or InFeedCycleRepeatOn() accordingly.
| GrinderCenterlessScreenV02 CYCLE Initialize | ( | ) |
Initialize the CYCLE state machine for the Centerless Grinder screen.
Sets up the complete CYCLE object including pound variable mappings, STATE and TYPE lookup tables, PASSES tracking, and helper methods. Specifically:
| GrinderCenterlessScreenV02 InitializeCenterlessGrinder | ( | ) |
Initialize all Centerless Grinder-specific screen objects and UI state.
Performs the complete initialization sequence for the Centerless Grinder screen, including:
| GrinderCenterlessScreenV02 InitializeGrindDress | ( | ) |
Initialize and layout the Grind Wheel dressing controls panel.
Builds a dynamic grid layout for the Grind Wheel (wheel 1) parameters, then shows or hides individual rows and UI groups based on current configuration. Specifically:
| GrinderCenterlessScreenV02 InitializeGrindMode | ( | ) |
Initialize the active grind mode based on enabled features and the current operation tab.
Reads the "InFeedEnabled" and "ThruFeedEnabled" OEM parameter strings and checks the current label of the OperationTabs notebook. Sets the screen-level GrindMode variable:
| GrinderCenterlessScreenV02 InitializeInFeedRates | ( | ) |
Initialize the In-Feed rates panel layout based on regulating wheel speed configuration.
Reads whether the Regulating Wheel Speeds in Cycle feature is enabled via IsRegulatingWheelSpeedsInCycleOn(). When enabled, shows the InFeedRegulatingWheelGroup and positions InFeedFeedratesGroup at Top = 349. When disabled, positions InFeedFeedratesGroup at Top = 385 and hides InFeedRegulatingWheelGroup.
| GrinderCenterlessScreenV02 InitializeOperatorPanels | ( | ) |
Configure operator panel button mappings specific to the Centerless Grinder.
Iterates through all configured operator panels and remaps spindle button commands for panels with part number "X15-14-21". On matching panels, the spindle forward button is mapped to "Grind Wheel Toggle", the spindle stop button is mapped to "Grind Wheel Off", and the spindle reverse command is cleared. This customizes the operator panel to control the grind wheel instead of the standard spindle.
| GrinderCenterlessScreenV02 InitializeRegulatingDress | ( | ) |
Initialize and layout the Regulating Wheel dressing controls panel.
Builds a dynamic grid layout for the Regulating Wheel (wheel 2) parameters, then shows or hides individual rows and UI groups based on current configuration. Specifically:
| GrinderCenterlessScreenV02 InitializeSignalScript | ( | ) |
Initialize the signal script handler table for all configured Mach4 instances.
For each Mach4 instance (0 to GetInstanceCount()-1), resolves the signal IDs for all mapped OEM parameter signals and registers handler closures in MACHINE_TYPE_SIG_LIBRARY_INST. Signals handled include:
| GrinderCenterlessScreenV02 InitializeThruFeedPartCounter | ( | ) |
Initialize the Thru-Feed part counter signal handler and persistent I/O points.
If the Thru-Feed part counter is disabled (IsThruFeedPartCounterEnabled() returns false), removes the "Grinding Wheel Dress Required" and "Regulating Wheel Dress Required" I/O points and returns early. Otherwise, creates both I/O points as permanent inputs, then looks up the ThruFeedPartCounterInput OEM parameter signal ID. If the signal is mapped and valid, registers a signal library handler that calls UpdateThruFeedPartCounter() on each falling edge (rising edge sets THRU_FEED_PART_COUNTER_STATE, falling edge triggers the count and clears it).
| GrinderCenterlessScreenV02 InitializeTolerances | ( | ) |
Initialize all position tolerance values from imperial defaults converted to current units.
Converts and stores the following tolerance values using w.ConvertFromImperialToCurrentUnits():
| GrinderCenterlessScreenV02 InitializeToolTableFields | ( | ) |
Initialize or update the tool table user field definitions for Centerless Grinder wheel attributes.
Defines a comprehensive field_table containing all wheel parameter fields for both Grind Wheel (_1 suffix) and Regulating Wheel (_2 suffix), including diameter, width, minimum diameter, minimum width, max RPM, SFM, commanded RPM, dress positions, safety clearance values, rotary dresser parameters, and speed mode choices. If the tool table is initialized, checks whether all fields already exist via w.IsToolTableUserFieldList(). If any fields are missing, writes the complete field list via w.AddToolTableUserFieldList(). If the tool table is not initialized, logs a warning and skips the write.
| GrinderCenterlessScreenV02 IsAtLoadPosition | ( | ) |
Check whether both the main slide and secondary slide are at their load positions.
Reads the appropriate load position from pound variable #500 (In-Feed) or #512 (Thru-Feed) depending on the active grind mode. Compares the main slide axis position against the load position using InPositionToleranceStandard. If the secondary slide axis is enabled, also compares it against the RW retract position (#515). Returns true only when both slides are within tolerance of their respective load positions.
| GrinderCenterlessScreenV02 IsAtThruFeedGrindPosition | ( | ) |
Check whether the upper/lower slide axis is at the Thru-Feed grind position.
Retrieves the active upper/lower axis ID via aux.GetUpperLowerAxisID(), reads the current axis position, and compares it against the Thru-Feed grind (finish) position from pound variable #516. Returns true if the axis is within InPositionToleranceFine of the grind position.
| GrinderCenterlessScreenV02 IsAtThruFeedRetractPosition | ( | ) |
Check whether the upper/lower slide axis is at the Thru-Feed retract position.
Retrieves the active upper/lower axis ID via aux.GetUpperLowerAxisID(), reads the current axis position, and compares it against the Thru-Feed retract position from pound variable #512. Returns true if the axis is within InPositionToleranceStandard of the retract position.
| GrinderCenterlessScreenV02 IsDisableWheelsStartingAutomaticallyOn | ( | ) |
Check whether the "Disable Wheels Starting Automatically" feature is enabled.
Reads Mach4 parameter 1929 using the cached parameter accessor. Returns true when the parameter value equals 1, meaning wheels must be started manually before cycle start.
| GrinderCenterlessScreenV02 IsDressInterruptActive | ( | ) |
Check whether the dress interrupt is currently active.
Reads pound variable #998 from the Mach4 controller. Returns true when the value equals 1, indicating a dress interrupt has been requested during a grind cycle.
| GrinderCenterlessScreenV02 IsEditModeActive | ( | ) |
Check whether Edit Mode is currently active based on button background color.
Checks the background color of "SetInFeedGrindPositionBtn" (or "SetThruFeedGrindPositionBtn" if the first is not found) against the standard button off color. If the color matches the off color, Edit Mode is inactive; otherwise it is active.
| GrinderCenterlessScreenV02 IsGCodeDisplayExtraLargeEnabled | ( | ) |
Check whether the extra-large G-code display mode is enabled for this screen.
Always returns false, indicating the extra-large G-code display is unconditionally disabled for the Centerless Grinder screen.
| GrinderCenterlessScreenV02 IsGrindPositionSet | ( | ) |
Check whether the grind position has been calibrated.
Reads the "IsGrindPositionSet" integer from the "MachMotion" Mach4 profile section. Returns true when the stored value equals 1, indicating the grind position has been set.
| GrinderCenterlessScreenV02 IsGrindWheelDressing | ( | ) |
Check whether the Grind Wheel is currently in a dress cycle.
Returns true if the screen-level IsGrindWheelDressCycle flag is set, or if aux.IsGrindWheelDressing() returns true. When the aux function detects active dressing, the local flag is cleared (set to false) before returning true.
| GrinderCenterlessScreenV02 IsGrindWheelDressingEnabled | ( | ) |
Check whether Grind Wheel dressing is enabled in OEM parameters.
Reads the "GrindDressEnabled" OEM parameter string and returns true if the value is "Yes".
| GrinderCenterlessScreenV02 IsGrindWheelEnabled | ( | ) |
Check whether the Grind Wheel is enabled.
Delegates to aux.IsGrindWheelEnabled() to determine grind wheel availability. The Grind Wheel on Centerless Grinders uses the Mach spindle control system.
| GrinderCenterlessScreenV02 IsHydraulicsEnabled | ( | ) |
Check whether the hydraulics system is enabled.
Delegates to aux.IsHydraulicsEnabled() to determine hydraulics availability.
| GrinderCenterlessScreenV02 IsInFeedCycleRepeatOn | ( | ) |
Check whether the In-Feed cycle repeat feature is currently enabled.
Reads Mach4 parameter 1920 using the cached parameter accessor. Returns true when the parameter value equals 1.
| GrinderCenterlessScreenV02 IsInFeedModeActive | ( | ) |
Check whether In-Feed grind mode is currently active.
Returns true when the screen-level GrindMode variable equals 1.
| GrinderCenterlessScreenV02 IsInterlockThatForcesRegulatingWheelToBeOnBeforeTheGrindinWheelOn | ( | ) |
Check whether the interlock requiring the Regulating Wheel to be on before the Grind Wheel is active.
Reads Mach4 parameter 1927 using the cached parameter accessor. Returns true when the parameter value equals 0, meaning the interlock that forces the regulating wheel to be running before the grinding wheel can start is active.
| GrinderCenterlessScreenV02 IsPartKicker | ( | ) |
Check whether the Part Kicker output signal is currently active.
Reads the "PartKickerOutput" OEM signal state if it is mapped. Returns true when the output is on (kicker is extended), false otherwise (including when not mapped).
| GrinderCenterlessScreenV02 IsPartKickerAtPosition | ( | PositionName | ) |
Check whether the Part Kicker OB Axis is at the specified named position.
Only valid when the OB Axis part kicker type is enabled. Reads the target position from pound variable #9067 (Home), #9068 (Load), or #9069 (Extend) based on PositionName. Compares the current OB axis machine position against the target using InPositionToleranceStandard. Returns false when the OB axis type is not enabled.
| PositionName | (string) The named position to check: "Home", "Load", or "Extend" |
| GrinderCenterlessScreenV02 IsPartKickerEnabled | ( | ) |
Check whether the Part Kicker feature is enabled (cached).
Uses the w.IsCached()/w.GetCache()/w.SetCache() pattern to cache the result per instance. Delegates to aux.IsPartKickerEnabled() on cache miss and stores the result.
| GrinderCenterlessScreenV02 IsPartKickerTypeOBAxisEnabled | ( | ) |
Check whether the Part Kicker OB Axis type is enabled and configured.
Uses the w.IsCached()/w.GetCache()/w.SetCache() pattern to cache the result per instance. Reads the "PartKickerTypeOBAxis" OEM parameter string and the "PartKickerOBAxisID" OEM parameter value, then checks that the specified OB axis is enabled. Returns true only when aux.IsPartKickerEnabled() is true, PartKickerTypeOBAxis is "Yes", and the OB axis is enabled.
| GrinderCenterlessScreenV02 IsPartLoaderLoad | ( | ) |
Check whether the part loader is currently executing a load cycle.
Reads pound variable #9080 from the Mach4 controller. Returns true when the value equals 6, indicating the part loader is in the load cycle state.
| GrinderCenterlessScreenV02 IsPartLoaderReady | ( | ) |
Validate all preconditions required before running a part loader cycle.
Checks the following conditions in order, displaying a warning message and returning false if any check fails:
| GrinderCenterlessScreenV02 IsPartLoaderUnload | ( | ) |
Check whether the part loader is currently executing an unload cycle.
Reads pound variable #9080 from the Mach4 controller. Returns true when the value equals 7, indicating the part loader is in the unload cycle state.
| GrinderCenterlessScreenV02 IsRegulatingWheelDressing | ( | ) |
Check whether the Regulating Wheel is currently in a dress cycle.
Returns true if the screen-level IsRegWheelDressCycle flag is set, or if aux.IsRegulatingWheelDressing() returns true. When the aux function detects active dressing, the local flag is cleared (set to false) before returning true.
| GrinderCenterlessScreenV02 IsRegulatingWheelDressingEnabled | ( | ) |
Check whether Regulating Wheel dressing is enabled in OEM parameters.
Reads the "RegDressEnabled" OEM parameter string and returns true if the value is "Yes".
| GrinderCenterlessScreenV02 IsRegulatingWheelEnabled | ( | ) |
Check whether the Regulating Wheel is enabled.
Delegates to aux.IsRegulatingWheelEnabled() to determine regulating wheel availability.
| GrinderCenterlessScreenV02 IsRegulatingWheelSpeedsInCycleOn | ( | ) |
Check whether the Regulating Wheel Speeds in Cycle feature is enabled.
Reads Mach4 parameter 1933 using the cached parameter accessor. Returns true when the parameter value equals 1.
| GrinderCenterlessScreenV02 IsRetracting | ( | ) |
Get the current retracting interlock state.
Returns the screen-level _IsRetracting flag, which indicates whether a retraction sequence is currently in progress.
| GrinderCenterlessScreenV02 IsThruFeedModeActive | ( | ) |
Check whether Thru-Feed grind mode is currently active.
Returns true when the screen-level GrindMode variable equals 2.
| GrinderCenterlessScreenV02 IsThruFeedPartCounterEnabled | ( | ) |
Check whether the Thru-Feed part counter feature is enabled.
Always returns true, indicating the Thru-Feed part counter is unconditionally enabled for this screen. Override in user scripts to conditionally disable the counter.
| GrinderCenterlessScreenV02 IsWheelsInPositionPartLoader | ( | ) |
Check whether both the main slide and secondary slide are in position for the part loader.
Determines the main slide in-position state based on the "PartLoaderUserLoadPositionFromScreen" OEM parameter: if "Yes", uses the cached MainSlideIsAtLoadPosition screen variable; otherwise reads the "PartLoaderMachinePosition" OEM parameter and compares the current upper/lower axis machine position against it using InPositionToleranceStandard. Returns true only when both the main slide and the SecondarySlideIsAtLoadPosition screen variable are true.
| GrinderCenterlessScreenV02 LayoutObjects layout | ( | ) |
Lay out all visible objects in the LayoutObjects grid.
Iterates through ObjectsInRows and positions each non-hidden row within the container. For each visible row, finds the tallest object to determine the row height, checks if the current column is full (top + row height exceeds Container.Height) and advances to a new column if necessary. Within each row, objects are placed left-to-right with per-object or default horizontal spacing. Objects shorter than the row height are vertically centered via an offset. Hidden rows have all their objects set to Hidden = "1". After all rows are processed, calls w.FunctionCompleted().
| GrinderCenterlessScreenV02 LoadJobFileFinal | ( | ) |
Finalize loading a job file by writing pound variables to the tool table and updating UI.
Called after a job file is opened. Reads the pound variable table from the current job, then for each pound variable >= 9000, searches the wheel attributes table for a matching field and writes the value to the tool table via mc.mcToolSetDataExDbl(). Additionally:
| GrinderCenterlessScreenV02 LowerSlideBtn | ( | ) |
Select the Lower Slide as the active upper/lower axis and refresh the axis position group.
Sets Mach4 parameter 1900 to 1 to select the Lower Slide axis, then calls InitializeAxisPositionGroup() to refresh the axis display.
| GrinderCenterlessScreenV02 MachineAutoLoadLastGCode | ( | ) |
Handle post-auto-load tab selection for multi-instance Centerless Grinder configurations.
After auto-loading the last G-code file, checks whether the selected instance is instance 1. If so, switches the OperationTabs notebook to tab index 4 (the Loader tab) to show the loader controls for the secondary instance.
| GrinderCenterlessScreenV02 MachineCreatePreCannedCommands | ( | ) |
Register all pre-canned commands available for the Centerless Grinder screen.
Creates and registers the full set of operator commands specific to the Centerless Grinder, including action options and feedback options. Commands registered include:
| GrinderCenterlessScreenV02 MachineCycleStartFinal | ( | ) |
Validate state and dispatch to the correct cycle start handler based on the active operation tab.
Performs pre-cycle-start checks and dispatches to the appropriate operation when the machine is IDLE and no M00 is active. Specifically:
| GrinderCenterlessScreenV02 MachineCycleStopFinal | ( | CustomMode | ) |
Perform the final cycle stop sequence for the Centerless Grinder.
Called when a cycle stop is processed. Executes the following in order:
| CustomMode | (number|nil) The retraction mode selector. Defaults to 0 if nil |
| GrinderCenterlessScreenV02 MachineDisable | ( | ) |
Reset machine state flags and set the cycle to idle on machine disable.
Clears the dress cycle flags via ClearIsWheelInDressCycleFlags() and sets the cycle state to idle via CYCLE.SetStateToIdle() when the machine is disabled.
| GrinderCenterlessScreenV02 MachinePostAutoLoadLastGCode | ( | ) |
Restore the last saved operation tab after auto-loading the last G-code file.
Called after the auto-load last G-code sequence completes. Delegates to RestoreLastRunTabIndex() to set the OperationTabs notebook back to the previously saved tab index.
| GrinderCenterlessScreenV02 MachineScreenLoadScript | ( | ) |
Execute all machine-specific screen load initialization for the Centerless Grinder.
Called during the screen load sequence. Performs the following initialization in order:
| GrinderCenterlessScreenV02 MachineScreenLowPriorityLoop | ( | ) |
Execute all low-priority periodic updates for the Centerless Grinder screen.
Called at low priority to update UI elements that do not require real-time refresh. Performs the following updates in order:
| GrinderCenterlessScreenV02 MachineScreenPLCScript | ( | ) |
Execute all real-time PLC cycle updates for the Centerless Grinder screen.
Called every PLC cycle to update time-critical UI state. Performs the following updates in order:
| GrinderCenterlessScreenV02 MachineScreenStartupScript | ( | ) |
Execute all machine-specific startup tasks for the Centerless Grinder screen.
Called during the screen startup sequence after the screen is loaded. Performs the following initialization in order:
| GrinderCenterlessScreenV02 MarqueeObject | ( | marquee | ) |
Animate a marquee indicator LED object to track axis position between two machine coordinates.
Computes a scaled screen position for a named UI object based on the current machine axis position mapped linearly between two machine coordinate endpoints (mach.start and mach.stop) and two screen pixel positions (object.start and object.stop). If the computed position falls outside the valid object range, moves the object off-screen (Left = 10000). Also positions the object vertically to object.top.
| marquee | (table) Configuration table with keys:
|
| GrinderCenterlessScreenV02 MoveToCycleStopRetractPosition | ( | Operation | ) |
Perform a protected cycle stop retract sequence.
Wraps the internal _MoveToCycleStopRetractPosition() function in a w.pcall() for error protection. On error, returns a formatted error message. On success, returns the standard completion status.
| Operation | (string|nil) The operation context for the retract (e.g., "In-Feed", "Grind Dressing"). Defaults to "" |
| GrinderCenterlessScreenV02 MoveToEmergencyRetractPosition | ( | ) |
Perform a protected emergency retract move sequence.
Wraps the internal _MoveToEmergencyRetractPosition() function in a w.pcall() for error protection. On error, returns a formatted error message. On success, returns the standard completion status.
| GrinderCenterlessScreenV02 MoveToLoadPosition | ( | infeed_load_pos | ) |
Move the active slide axis and optional secondary slide to the load or retract position.
Verifies homing status before moving. Reads the load position from pound variable #500 (In-Feed or forced infeed_load_pos) or #512 (Thru-Feed retract). Shows a Cycle Start confirmation dialog before executing the motion. Also moves the secondary slide (if enabled) to the RW retract position (#515). Incorporates the Part Kicker move-to-load-position G-code if applicable.
| infeed_load_pos | (boolean|nil) If true, forces use of the In-Feed load position (#500) regardless of active mode. Defaults to false |
| GrinderCenterlessScreenV02 MoveToRetractPosition | ( | CustomMode | ) |
Move the active slide to the retract position with reentrancy protection.
Checks the IsRetracting interlock before proceeding. If already retracting, returns immediately with an error. Otherwise selects the retract function based on CustomMode:
| CustomMode | (number) The retraction mode selector (0 or 10 for cycle stop retract) |
| GrinderCenterlessScreenV02 LayoutObjects new | ( | grid_objects | ) |
Create a new LayoutObjects grid instance from a configuration table.
Constructs a new LayoutObjects object using the provided grid_objects configuration table by copying all key-value pairs into a new metatable-based object. The grid_objects table should contain:
| grid_objects | (table) Configuration table defining the layout grid parameters and object rows |
| GrinderCenterlessScreenV02 NewDressProgramBtn | ( | dresser_type | ) |
Open the Profile Dressing wizard to create a new dress profile program.
Calls OpenDressProfiler() with sub_number = 0 to signal creation of a new program rather than editing an existing one.
| dresser_type | (string) The dresser type for the new profile: "GrindWheel" or "RegWheel" |
| ProfileDressing OnDestroy | ( | ) |
Callback invoked when the Profile Dressing wizard window is destroyed.
Resets the m.screen.profile_dressing_open flag to false, allowing the Profile Dressing wizard to be reopened in the future. This is assigned as a closure inside OpenDressProfiler() immediately after the ProfileDressing module is loaded.
| GrinderCenterlessScreenV02 OpenDressProfiler | ( | dresser_type | , |
| sub_number | ) |
Open the Profile Dressing wizard for editing or creating a dress profile.
Loads the ProfileDressing Lua module from the Wizards directory and initializes it with the specified dresser type and subroutine number. Uses an interlock flag (profile_dressing_open) to prevent opening multiple instances simultaneously. For existing profiles (sub_number > 0), validates that the file exists on disk before opening. The wizard's OnDestroy callback clears the interlock flag when the window is closed. File extensions used: .cgw for Grind Wheel profiles, .crw for Regulating Wheel profiles.
| dresser_type | (string) The dresser type to edit: "GrindWheel" or "RegWheel" |
| sub_number | (number) The subroutine number to open (0 to create a new profile) |
| GrinderCenterlessScreenV02 OpenDressProgramBtn | ( | dresser_type | ) |
Open a file dialog to select and load an existing custom dress profile program.
Displays a file open dialog filtered to the appropriate dress profile file extension (.cgw for Grind Wheel, .crw for Regulating Wheel). Validates that the selected subroutine number is in the range 2000-3999. On successful selection, stores the program number to the profile and writes it to the appropriate pound variable (#518 or #519). The dialog loops until a valid subroutine is chosen or the user cancels.
| dresser_type | (string) The dresser type: "GrindWheel" or "RegWheel" |
| GrinderCenterlessScreenV02 PartKickerManualCycle | ( | ) |
Trigger a manual kick cycle for the Part Kicker.
Sets the PartKicker.StartManualCycle flag to true when the part kicker is enabled. The UpdatePartKicker() PLC loop will detect this flag and execute the kick cycle. Has no effect when the part kicker is disabled.
| GrinderCenterlessScreenV02 PartKickerManualCycleRetract | ( | ) |
Trigger a manual retract cycle for the Part Kicker.
Sets the PartKicker.StartManualCycleRetract flag to true when the part kicker is enabled. The UpdatePartKicker() PLC loop will detect this flag and execute the retract cycle. Has no effect when the part kicker is disabled.
| GrinderCenterlessScreenV02 PartKickerMoveToPosition | ( | PositionName | ) |
Move the Part Kicker OB Axis to the specified named position via the axis jogger.
Only valid when the OB Axis part kicker type is enabled. Reads the target position from pound variable #9067 (Home), #9068 (Load), or #9069 (Extend) based on PositionName, then calls OBAxisJogger:JogABS() to move the axis to that position at the configured feedrate. Has no effect when the OB axis type is not enabled or when PositionName is unrecognized.
| PositionName | (string) The named position to move to: "Home", "Load", or "Extend" |
| GrinderCenterlessScreenV02 PartKickerTeachPosition | ( | PositionName | ) |
Teach a Part Kicker OB Axis position by storing the current machine position.
Only valid when the OB Axis part kicker type is enabled. Reads the current machine position of the OB axis and writes it to the appropriate pound variable: #9067 (Home), #9068 (Load), or #9069 (Extend), based on the PositionName argument. Has no effect when the OB axis type is not enabled or when PositionName is unrecognized.
| PositionName | (string) The named position to teach: "Home", "Load", or "Extend" |
| GrinderCenterlessScreenV02 PartLoaderAlarmActive | ( | ) |
Create or update a GMS Alarm dialog when the part loader enters an alarmed state.
Reads the "PartLoaderAlarmMessageRegister" OEM signal to obtain a numeric alarm code. Looks up the corresponding description in the "PartLoaderAlarmMessages" OEM parameter (parsed as a multi-line CSV table). If no matching description is found, uses a default formatted string. Checks for an existing GMS notification with the title "Part Loader Alarm!"; if one exists, updates its description. Otherwise creates a new GMS notification with Class "Alarm" that clears when the "PartLoaderAlarmInput" OEM signal goes high.
| GrinderCenterlessScreenV02 PartLoaderIsMachineEmpty | ( | ) |
Check whether the machine is currently empty (no part loaded).
Reads pound variable #9065 from the Mach4 controller. Returns true when the value equals 0, indicating no part is present in the machine.
| GrinderCenterlessScreenV02 PartLoaderLoad | ( | ) |
Initiate a part loader load cycle when the machine is idle and loader is ready.
Checks that the machine is in IDLE state and that IsPartLoaderReady() returns true. For multi-instance configurations with the "Muilti-Inst-Subroutine" part loader type, executes "G65 P700\n G65 P701" on the part loader instance. Otherwise executes "G65 P9540" on the main instance.
| GrinderCenterlessScreenV02 PartLoaderMachineEmpty | ( | ) |
Set pound variable #9065 to zero when the machine is idle, marking it as empty.
Checks that the machine state (MACH_STATE) is MC_STATE_IDLE before writing 0 to pound variable #9065 via mc.mcCntlSetPoundVar(). This signals to the G-code program that no part is currently loaded in the machine.
| GrinderCenterlessScreenV02 PartLoaderNoticeMessageActive | ( | ) |
Create or update a GMS Notice dialog when the part loader sends a notice message.
Reads the "PartLoaderNoticeMessageRegister" OEM signal to obtain a numeric message code. Looks up the corresponding description in the "PartLoaderNoticeMessages" OEM parameter (parsed as a multi-line CSV table). If no matching description is found, uses a default formatted string. Checks for an existing GMS notification with the title "Part Loader Message!"; if one exists, updates its description. Otherwise creates a new GMS notification with Class "Notice" that clears when the "PartLoaderNoticeInput" OEM signal goes high.
| GrinderCenterlessScreenV02 PartLoaderRetractCycle | ( | ) |
Execute a part loader retract cycle via MDI or multi-instance subroutine.
Checks whether the part loader is enabled and on before issuing a retract command. For multi-instance configurations with the "Muilti-Inst-Subroutine" loader type, resets the part loader instance and executes "G65 P710" via MDI on that instance when it is idle. For single-instance configurations with the "Subroutine" loader type, executes "G65 P710" via w.MDICommand() on the main instance.
| GrinderCenterlessScreenV02 PartLoaderUnload | ( | ) |
Initiate a part loader unload cycle when the machine is idle and loader is ready.
Checks that the machine is in IDLE state and that IsPartLoaderReady() returns true. For multi-instance configurations with the "Muilti-Inst-Subroutine" part loader type, executes "G65 P703" on the part loader instance. Otherwise executes "G65 P9541" on the main instance.
| GrinderCenterlessScreenV02 PreCycleStop | ( | ) |
Check pre-conditions before executing a cycle stop.
Checks whether a retraction is already in progress via IsRetracting(). If so, returns false to abort the cycle stop. Otherwise saves the current cycle type to CycleTypeOnStop for use during the retract sequence and returns true to allow the stop.
| GrinderCenterlessScreenV02 RegDressCompDiamondOperatorPanelBtn | ( | diamond_traverse | , |
| Direction | , | ||
| Amount | ) |
Apply a compensation adjustment to a Regulating Wheel dresser axis from the operator panel.
Logs the operator action, validates that the machine is enabled, then dispatches to Comp() with Type 3 (dresser compensation) for the appropriate axis based on diamond_traverse: "Diamond" maps to A_AXIS, "Traverse" maps to Z_AXIS. Defaults Direction to 1 and Amount to "Fine" if not provided.
| diamond_traverse | (string) The dresser component to compensate: "Diamond" or "Traverse" |
| Direction | (number|nil) Compensation direction: 1 (out) or -1 (in). Defaults to 1 if nil |
| Amount | (string|nil) Compensation step size: "Fine" or "Coarse". Defaults to "Fine" if nil |
| GrinderCenterlessScreenV02 RegDressTeachDiamondOperatorPanelBtn | ( | diamond_traverse | ) |
Teach the Regulating Wheel dresser diamond or traverse position from the operator panel.
Logs the operator action and validates that the machine is enabled and the Regulating Wheel tab is currently active. If "Diamond" is selected, teaches the "2DressPosition_2" field and then moves A axis to home (A0.0). If "Traverse" is selected, teaches the "1DressPosition_2" field without a subsequent move.
| diamond_traverse | (string) The dresser component to teach: "Diamond" or "Traverse" |
| GrinderCenterlessScreenV02 RegulatingWheelSpeedsInCycleOff | ( | ) |
Disable the Regulating Wheel Speeds in Cycle feature.
Sets Mach4 parameter 1933 to 0 to disable regulating wheel speed display in the In-Feed cycle, then refreshes the In-Feed rates panel layout.
| GrinderCenterlessScreenV02 RegulatingWheelSpeedsInCycleOn | ( | ) |
Enable the Regulating Wheel Speeds in Cycle feature.
Sets Mach4 parameter 1933 to 1 to enable regulating wheel speed display in the In-Feed cycle, then refreshes the In-Feed rates panel layout.
| GrinderCenterlessScreenV02 RegulatingWheelSpeedsInCycleToggle | ( | ) |
Toggle the Regulating Wheel Speeds in Cycle setting on or off.
Checks the current state via IsRegulatingWheelSpeedsInCycleOn() and calls either RegulatingWheelSpeedsInCycleOff() or RegulatingWheelSpeedsInCycleOn() accordingly, then updates the In-Feed rates display.
| GrinderCenterlessScreenV02 RegWheelSpeedModeRPMBtn | ( | ) |
Set the Regulating Wheel speed mode to RPM and refresh dependent UI.
Sets the "SurfaceFeetPerMinMode_2" tool table user field to 0 (RPM mode), then calls UpdateGrinderWheelAttributes(), UpdateWheelSpeedModeButtons(), and InitializeRegulatingDress() to refresh all affected UI elements.
| GrinderCenterlessScreenV02 RegWheelSpeedModeSFMBtn | ( | ) |
Set the Regulating Wheel speed mode to SFM and refresh dependent UI.
Sets the "SurfaceFeetPerMinMode_2" tool table user field to 1 (SFM mode), then calls UpdateGrinderWheelAttributes(), UpdateWheelSpeedModeButtons(), and InitializeRegulatingDress() to refresh all affected UI elements.
| GrinderCenterlessScreenV02 ReloadDressProgramBtn | ( | ) |
Reload the currently selected dress program from disk.
Delegates to m.screen.ReloadDressProgram() to reload the active dress program file.
| GrinderCenterlessScreenV02 ResetExtraUpperLowerCompBtn | ( | ) |
Reset the Extra Comp Amount OEM parameter to zero.
Sets the "ExtraCompAmount" OEM parameter to 0, clearing any accumulated extra compensation that was queued for the next grind cycle.
| GrinderCenterlessScreenV02 ReSetGrindPositionSetIndicator | ( | ) |
Clear the grind position calibrated flag in the machine profile.
Writes 0 to the "IsGrindPositionSet" key in the "MachMotion" profile section, marking the grind position as not calibrated.
| GrinderCenterlessScreenV02 ResetPartCounterBtn | ( | ) |
Stub handler for the Reset Part Counter button.
Returns a no-op success result. Part counter reset logic is handled elsewhere.
| GrinderCenterlessScreenV02 ResetTotalCompBtn | ( | AxisID | ) |
Reset the total compensation accumulator for the specified axis.
Delegates to m.screen.ResetTotalAxisComp() with the provided AxisID to clear the per-axis total compensation register.
| AxisID | (number) The Mach4 axis ID whose total compensation should be reset |
| GrinderCenterlessScreenV02 ResetUpperLowerTotalCompBtn | ( | ) |
Reset the total compensation accumulator for the active upper/lower slide axis.
Retrieves the active upper/lower axis ID via aux.GetUpperLowerAxisID() and delegates to ResetTotalCompBtn() to clear the total compensation register for that axis.
| GrinderCenterlessScreenV02 RestoreLastRunTabIndex | ( | ) |
Restore the last saved operation tab index and set the active tab.
Reads the "LastRunTabNumber" integer from the "MachMotion" Mach4 profile section. Sets both the "Default Tab" and "Current Tab" properties of the "OperationTabs" notebook object to the restored index value. Logs the restore action.
| GrinderCenterlessScreenV02 RunGrindWheelDressCycle | ( | ignore_confirmation | ) |
Initiate a Grind Wheel dress cycle with optional confirmation dialog.
Sets the grinder operation number to 5 (Grind Wheel Dressing), validates machine state (must be IDLE), checks wheel interlocks (regulating wheel interlock if configured, and grind wheel on if DisableWheelsStartingAutomatically is active), releases any active cycle start hold, sets the IsGrindWheelDressCycle flag, and optionally shows a confirmation dialog before setting RunDressCycle = true and calling m.CycleStartBtn(). If a cycle start hold is active, releases it and re-queues this function.
| ignore_confirmation | (boolean|nil) If true, skips the confirmation dialog. Defaults to false |
| GrinderCenterlessScreenV02 RunRegulatingWheelDressCycle | ( | ignore_confirmation | ) |
Initiate a Regulating Wheel dress cycle with optional confirmation dialog.
Sets the grinder operation number to 6 (Regulating Wheel Dressing), validates machine state (must be IDLE), checks wheel interlocks, releases any active cycle start hold, sets the IsRegWheelDressCycle flag, and optionally shows a confirmation dialog before setting RunDressCycle = true and calling m.CycleStartBtn(). If ignore_confirmation is true, skips the dialog. If a cycle start hold is active, releases it and re-queues this function.
| ignore_confirmation | (boolean|nil) If true, skips the confirmation dialog. Defaults to false |
| GrinderCenterlessScreenV02 RWCustomDressProfileBtn | ( | ) |
Toggle the Regulating Wheel custom dress profile program on or off.
Reads the current regulating wheel custom dress subroutine number from pound variable #519. If the subroutine number is non-zero, stores it via StoreLastRegDressCustomProgram() and then clears #519 to zero (disabling the custom profile). If zero, reads the last stored program number from the machine profile and writes it to #519 (enabling the custom profile). Updates the regulating wheel custom dress profile UI via UpdateRWCustomDressProfile() afterwards.
| GrinderCenterlessScreenV02 SaveCurrentRunTabIndex | ( | tab | ) |
Save the current operation tab index to the machine profile.
Writes the provided tab index number to the "MachMotion" section of the Mach4 profile under the key "LastRunTabNumber" for persistence across sessions. Logs the save action.
| tab | (number) The tab index number to save |
| GrinderCenterlessScreenV02 ScreenIsLoadedScript | ( | ) |
Run all post-screen-load initialization tasks for the Centerless Grinder.
Called after the screen is fully loaded. Performs the following in order:
| GrinderCenterlessScreenV02 ScreenTabEnter | ( | tab | ) |
Handle tab enter events for the Centerless Grinder operation and service tabs.
Called when a tab is entered in any notebook. Behavior depends on the tab parent and label:
| tab | (table) The tab object with fields: parent (string), label (string), index (number), name (string) |
| GrinderCenterlessScreenV02 ScreenTabExit | ( | tab | ) |
Handle tab exit events for the Centerless Grinder operation tabs.
Called when a tab is exited in the OperationTabs notebook. Specifically:
| tab | (table) The tab object with fields: parent (string), label (string), index (number), name (string) |
| GrinderCenterlessScreenV02 SetGrinderOperationNumber | ( | OperationNumber | ) |
Set the active grinder operation number in Mach4 pound variable #546.
Writes the provided OperationNumber to pound variable #546 via mc.mcCntlSetPoundVar(), which is used by the G-code program to determine which operation to execute.
| OperationNumber | (number) The operation number to set (e.g., 3=In-Feed, 4=Thru-Feed, 5=GW Dress, 6=RW Dress) |
| GrinderCenterlessScreenV02 SetGrindPosition | ( | ) |
Set the grind finish position by prompting the operator for a new value.
Validates machine state and optionally shows a confirmation dialog before prompting the operator to enter a new finish/grind position value via a number input dialog. Reads the current finish position from pound variable #511 (In-Feed) or #516 (Thru-Feed) depending on the active grind mode. Validates that the entered position is within bounds (< 12), then calls mc.mcAxisSetPos() for the main slide axis and optionally the secondary slide axis. Also calls the "SetGrindPosition" and "SetGrindPositionFinal" screen hooks and optionally moves to the load position after setting.
| GrinderCenterlessScreenV02 SetGrindPositionSetIndicator | ( | ) |
Set the grind position calibrated flag in the machine profile.
Writes 1 to the "IsGrindPositionSet" key in the "MachMotion" profile section, marking the grind position as calibrated.
| GrinderCenterlessScreenV02 SetIsGrindWheelInDressCycleFlag | ( | ) |
Set the flag indicating the Grind Wheel is currently in a dress cycle.
Sets the screen-level IsGrindWheelDressCycle flag to true, indicating that a grind wheel dress cycle is currently active or pending.
| GrinderCenterlessScreenV02 SetIsRegWheelInDressCycleFlag | ( | ) |
Set the flag indicating the Regulating Wheel is currently in a dress cycle.
Sets the screen-level IsRegWheelDressCycle flag to true, indicating that a regulating wheel dress cycle is currently active or pending.
| GrinderCenterlessScreenV02 SetPartLoaderGripperToLowerSlideOffset | ( | ) |
Teach and store the gripper-to-lower-slide offset for the part loader.
Runs the "SetPartLoaderGripperToLowerSlideOffset" screen hook first; if the hook returns false, exits early. Shows a Cycle Start confirmation dialog asking the operator to jog the gripper axis to the part on the lower slide blade. On confirmation, reads the current machine position of the upper/lower axis and the part loader X axis, computes the offset as their sum, and stores it to the "PartLoaderGripperToLowerSlideOffset" OEM parameter on both the main instance and the part loader instance.
| GrinderCenterlessScreenV02 SetRetracting | ( | new_state | ) |
Set the retracting interlock state and log the change.
Updates the screen-level _IsRetracting flag to the provided state and logs the change at the [Retract] log level. This flag prevents multiple simultaneous retraction sequences from executing.
| new_state | (boolean) The new retracting state: true to set retracting, false to clear |
| GrinderCenterlessScreenV02 ShowHideSpindleGroup | ( | groupname | , |
| showhide | ) |
Hide a spindle group UI element by name (unconditionally).
Always sets the named group's "Hidden" property to "1" regardless of the showhide parameter. Spindle groups are not applicable to the Centerless Grinder screen.
| groupname | (string) The name of the screen group object to hide |
| showhide | (any) Accepted but ignored; the group is always hidden |
| GrinderCenterlessScreenV02 ShowInScreenGCodeEditor | ( | ) |
Show the in-screen G-code editor and hide the standard tool path display.
Calls HideGCodeDisplayAndToolPath() to hide the tool path view, then hides ToolDisplayGroup and ModalsGroup, and repositions the GCodeEditor to Left = 106 to make it visible within the screen layout.
| GrinderCenterlessScreenV02 StoreLastGrindDressCustomProgram | ( | SubNumber | ) |
Store the last used Grind Wheel custom dress program number to the machine profile.
Writes the provided subroutine number to the Mach4 profile under the "CenterlessGrinder" section with key "GrindDressCustomProgram" for persistence across sessions.
| SubNumber | (number) The subroutine number to store as the last used grind dress program |
| GrinderCenterlessScreenV02 StoreLastRegDressCustomProgram | ( | SubNumber | ) |
Store the last used Regulating Wheel custom dress program number to the machine profile.
Writes the provided subroutine number to the Mach4 profile under the "CenterlessGrinder" section with key "RegDressCustomProgram" for persistence across sessions.
| SubNumber | (number) The subroutine number to store as the last used regulating dress program |
| GrinderCenterlessScreenV02 ThruFeedCompMainGrindAxis | ( | Direction | , |
| Amount | ) |
Apply a compensation adjustment to the main grind axis for Thru-Feed mode.
Retrieves the active upper/lower axis ID and reads the current axis position and the Thru-Feed grind position (#516). If the axis is within 2x InPositionToleranceStandard of the grind position, uses Type 2 compensation (offset + move to finish position); otherwise uses Type 1 (offset only). Delegates to CompMainGrindAxis() for the actual compensation.
| Direction | (number) Compensation direction: 1 (out) or -1 (in) |
| Amount | (string) Step size: "Fine" or "Coarse" |
| GrinderCenterlessScreenV02 ThruFeedInBtn | ( | ) |
Handle the Thru-Feed In button press to move to the grind position.
Calls GoToThruFeedGrindPosition() with confirmation behavior determined by w.PretendCommandsAreFromOperatorPanels(). When pretending operator panel commands, confirmation is skipped.
| GrinderCenterlessScreenV02 ThruFeedOutBtn | ( | ) |
Handle the Thru-Feed Out button press to move to the retract position.
Calls GoToThruFeedRetractPosition() with confirmation behavior determined by w.PretendCommandsAreFromOperatorPanels(). When pretending operator panel commands, confirmation is skipped.
| GrinderCenterlessScreenV02 TouchOffTeachY | ( | ) |
Teach the Y-axis touch-off position by reading the current machine position.
Reads the current machine position of the Y_AXIS via mc.mcAxisGetMachinePos() and writes it to the "YTouchOffDRO" screen object. Used during tool calibration to capture the machine position at the touch-off point.
| GrinderCenterlessScreenV02 TouchOffTeachZ | ( | ) |
Teach the Z-axis touch-off position by reading the current machine position.
Reads the current machine position of the Z_AXIS via mc.mcAxisGetMachinePos() and writes it to the "ZTouchOffDRO" screen object. Used during tool calibration to capture the machine position at the touch-off point.
| cyc UpdateCombLabels | ( | dressing_passes | , |
| _type | , | ||
| type_passes | ) |
Update all combined cycle label objects with the current state and type descriptions.
Formats a label string combining the cycle type description and state description. When the current state is a dressing or sparkout state, appends the remaining pass count to the state description. Logs the combined state/type info and updates all screen objects listed in self.CombLabels (e.g., "CurrentCycleLabel").
| state | (table) The current state object with a "Description" field |
| dressing_passes | (number) The number of remaining dressing passes to display |
| _type | (table) The current cycle type object with a "Description" field |
| type_passes | (number) The number of type-specific passes (accepted but not used directly) |
| GrinderCenterlessScreenV02 UpdateGrindPositionSetIndicator | ( | ) |
Update the grind position calibration indicator LEDs and labels on screen.
Reads the grind position calibration state via IsGrindPositionSet(). When not calibrated, sets the InFeedGrindPositionSetLED and ThruGrindPositionSetLED labels to "Grind\nPosition Not Calibrated" and alternates between yellow and red color schemes using BLINK_OBJECT_SLOW_ACTIVE. When calibrated, sets the labels to "Grind\nPosition Calibrated" and clears the yellow LED state.
| GrinderCenterlessScreenV02 UpdateGWCustomDressProfile | ( | ) |
Update the Grind Wheel custom dress profile button and group visibility.
Reads the active grind wheel custom dress subroutine number from pound variable #518. If the subroutine number is non-zero, shows the GrindDressCustomProgramGroup and activates the GWCustomProfileBtn toggle button. If zero, hides the group and deactivates the button.
| GrinderCenterlessScreenV02 UpdateInFeedControls | ( | ) |
Update all In-Feed cycle position indicators, marquee LED, and axis position display.
Runs every PLC cycle to update the In-Feed grind cycle UI. Performs the following:
| GrinderCenterlessScreenV02 UpdateLowPriorityGrinderControls | ( | ) |
Update all low-priority grinder screen controls and indicators.
Runs at low priority and updates multiple UI elements including: upper/lower slide button highlight colors, compensation button labels showing current Fine/Coarse comp amounts (from #590 and #591), total compensation DRO value, upper/lower axis text and home/zero button colors based on the active slide selection, and then calls UpdateGWCustomDressProfile(), UpdateRWCustomDressProfile(), and UpdatePartCounters(). The active slide axis (upper or lower) is highlighted in green; the inactive one is cleared.
| GrinderCenterlessScreenV02 UpdateMPGAxisSelector | ( | ) |
Stub function that disables MPG axis selector updates for this screen.
| GrinderCenterlessScreenV02 UpdatePartCounters | ( | ) |
Update background colors of part counter DRO objects based on their values.
Iterates through the part counter DROs ("RequiredPartsDRO", "PartsPerGWDressDRO", "RegPartsPerDressDRO") and sets each one's background color to the muted green color scheme when its value is greater than zero, or to the standard write DRO color when the value is zero or negative. This provides a visual indicator that a counter limit has been configured.
| GrinderCenterlessScreenV02 UpdatePartKicker | ( | ) |
Update the Part Kicker state machine and control outputs each PLC cycle.
Manages the complete Part Kicker cycle logic, supporting both pneumatic/hydraulic cylinder and OB Axis actuator types. On each call:
| GrinderCenterlessScreenV02 UpdatePartLoader | ( | ) |
Update the part loader interlock outputs and motion inhibit signals.
Reads the current wheel-in-position state via IsWheelsInPositionPartLoader() and sets the "PartLoaderWheelsInPositionOutput" OEM signal accordingly (if mapped). Also monitors the "PartLoaderInCycleInput" OEM signal: on a rising edge (false -> true), inhibits jogging on all axes and sets ISIG_MOTION_INHIBIT, ISIG_JOG_INHIBIT, and ISIG_MPG_INHIBIT signals; on a falling edge (true -> false), releases all inhibits. Tracks state in the PartLoaderInCycleInput screen variable to detect edge transitions.
| GrinderCenterlessScreenV02 UpdateRWCustomDressProfile | ( | ) |
Update the Regulating Wheel custom dress profile button and group visibility.
Reads the active regulating wheel custom dress subroutine number from pound variable #519. If the subroutine number is non-zero, shows the RegDressCustomProgramGroup and activates the RWCustomProfileBtn toggle button. If zero, hides the group and deactivates the button.
| GrinderCenterlessScreenV02 UpdateSpindleMinMaxSpeed | ( | ) |
Stub function that disables spindle min/max speed updates for this screen.
| GrinderCenterlessScreenV02 UpdateThruFeedControls | ( | ) |
Update the Thru-Feed grind cycle position indicators and marquee LED.
Reads the active upper/lower axis position and compares it against the Thru-Feed retract position (#512) and finish/grind position (#516). Updates the RetractedLED and InPositionLED indicator states accordingly. When the machine is IDLE, positions the ThruFeedMarqueeLED to indicate the current slide position within the retract-to-grind range. When in cycle state 100 (Moving to Grind Position), animates the marquee between retract and finish positions.
| GrinderCenterlessScreenV02 UpdateThruFeedPartCounter | ( | ) |
Increment the Thru-Feed part counters and trigger dress-required notifications.
Reads the parts-since-last-dress counters for both the Grind Wheel (#9071) and Regulating Wheel (#9171), increments each by one, and compares them against the configured parts-per-dress thresholds (#9070 and #9170 respectively). When either threshold is reached:
| GrinderCenterlessScreenV02 UpdateWheelSpeedModeButtons | ( | ) |
Update the RPM/SFM mode toggle button highlight colors for both wheel speed panels.
Reads the "SurfaceFeetPerMinMode_1" tool table field for the Grind Wheel and "SurfaceFeetPerMinMode_2" for the Regulating Wheel. For each wheel, highlights the SFM button with BTN_COLOR_ON and dims the RPM button with BTN_COLOR_OFF when SFM mode is active (value == 1), or vice versa when RPM mode is active (value != 1).
| GrinderCenterlessScreenV02 UpperSlideBtn | ( | ) |
Select the Upper Slide as the active upper/lower axis and refresh the axis position group.
Sets Mach4 parameter 1900 to 0 to select the Upper Slide axis, then calls InitializeAxisPositionGroup() to refresh the axis display.
| GrinderCenterlessScreenV02 ValidateCycleData | ( | value | , |
| name | ) |
Validate a single cycle data value against business rules for the given field name.
Checks the provided value against specific constraints based on the DRO/field name. For In-Feed fields, checks include:
| value | (number) The numeric value to validate |
| name | (string) The DRO or field name identifying which validation rules to apply |
References name().
| GrinderCenterlessScreenV02 ValidateCycleDataList | ( | datatable | ) |
Validate a list of cycle data pound variables against their business rules.
Iterates through the provided data table, reads each pound variable from the Mach4 controller, and calls ValidateCycleData() for each entry. Collects all validation results and returns a combined success flag. All entries are checked even if one fails.
| datatable | (table) Array of validation entries, where each entry is a table with:
|
| GrinderCenterlessScreenV02 ValidateDROValue | ( | value | , |
| name | ) |
Validate a DRO value string and return the corrected value as a string.
Converts the input string to a number, strips any index suffix from the name using h.GetObjectNameCore(), then delegates to ValidateCycleData() for business rule checking. Logs the before/after values for diagnostics. Returns the value as a string suitable for setting back into a screen DRO object.
| value | (string) The DRO value string to validate |
| name | (string) The DRO object name (may include instance suffix like "(1)") |
References name().
| GrinderCenterlessScreenV02 ValidateInFeedCycleData | ( | ) |
Validate all In-Feed cycle data against required business rules.
Reads the full set of In-Feed cycle pound variables and validates each one using ValidateCycleDataList(). Fields validated include finish/load/retract positions, dwell timers, feed amounts (Fine/Medium/Coarse), and feedrates. Called before starting an In-Feed cycle to prevent invalid cycle execution.
| GrinderCenterlessScreenV02 ValidateThruFeedCycleData | ( | ) |
Validate all Thru-Feed cycle data against required business rules.
Reads the Thru-Feed retract position (#512) and grind position (#516) pound variables and validates them using ValidateCycleDataList(). Called before starting a Thru-Feed cycle.
| GrinderCenterlessScreenV02 WheelSpeedModeRPMBtn | ( | ) |
Set the Grind Wheel speed mode to RPM and refresh dependent UI.
Sets the "SurfaceFeetPerMinMode_1" tool table user field to 0 (RPM mode), then calls UpdateGrinderWheelAttributes(), UpdateWheelSpeedModeButtons(), and InitializeGrindDress() to refresh all affected UI elements.
| GrinderCenterlessScreenV02 WheelSpeedModeSFMBtn | ( | ) |
Set the Grind Wheel speed mode to SFM and refresh dependent UI.
Sets the "SurfaceFeetPerMinMode_1" tool table user field to 1 (SFM mode), then calls UpdateGrinderWheelAttributes(), UpdateWheelSpeedModeButtons(), and InitializeGrindDress() to refresh all affected UI elements.