|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| GrinderODIDKaydonGUIModule | PLCScript () |
| Execute the periodic PLC script update for the Kaydon OD/ID grinder screen. | |
| GrinderODIDKaydonGUIModule | MachineCycleStart () |
| Validate preconditions before allowing a machine cycle start on the Kaydon OD/ID grinder. | |
| GrinderODIDKaydonGUIModule | MachineCycleStartFinal () |
| Finalize cycle start by rewinding the G-code file when the machine is idle and no M00 is active. | |
| GrinderODIDKaydonGUIModule | MachineReset () |
| Reset all active grind state pound variables to their default cleared values. | |
| GrinderODIDKaydonGUIModule | MachineCycleStop () |
| Capture the current cycle and machine state at the moment of cycle stop. | |
| GrinderODIDKaydonGUIModule | MachineCycleStopFinal () |
| Finalize the cycle stop sequence by resetting grind state variables and retracting axes to safe positions. | |
| GrinderODIDKaydonGUIModule MachineCycleStart | ( | ) |
Validate preconditions before allowing a machine cycle start on the Kaydon OD/ID grinder.
Performs a series of interlock and UI state checks before permitting the cycle to begin:
| GrinderODIDKaydonGUIModule MachineCycleStartFinal | ( | ) |
Finalize cycle start by rewinding the G-code file when the machine is idle and no M00 is active.
If the machine state (MACH_STATE) is MC_STATE_IDLE and no M00 program stop is currently active, this function rewinds the loaded G-code file to the beginning using mc.mcCntlRewindFile(). This ensures the program always starts from the top when initiating a new cycle from an idle state. If an M00 is active, the rewind is skipped to allow resumption from the current position.
| GrinderODIDKaydonGUIModule MachineCycleStop | ( | ) |
Capture the current cycle and machine state at the moment of cycle stop.
Records the current cycle state name via GetCycleStateName() and the Mach4 controller state into module-level variables CYCLE_STATE_AT_STOP and MACH_STATE_AT_STOP respectively. These values are later consumed by MachineCycleStopFinal() to determine the appropriate retract sequence.
| GrinderODIDKaydonGUIModule MachineCycleStopFinal | ( | ) |
Finalize the cycle stop sequence by resetting grind state variables and retracting axes to safe positions.
Executes the final actions after a cycle stop is confirmed. If the machine is enabled, this function resets pound variables 550, 720, and 700 (grind state flags) to 0, retrieves safe and clear positions from pound variables 530 (X Safe), 531 (Z Safe), and 532 (X Clear), and issues MDI retract moves based on the cycle state captured at stop time (CYCLE_STATE_AT_STOP) and the machine state (MACH_STATE_AT_STOP). For grinding states (STATE_GRIND_POSITIONING, STATE_DRESS_PULLOUT, STATE_GRIND_GRINDING, STATE_GRIND_SPARKOUT, STATE_GRIND_FINISHED), the retract sequence moves to X Safe, then Z Safe, then X Clear. For dressing states (STATE_DRESS_POSITIONING, STATE_DRESS_DRESSING, STATE_DRESS_SPARKOUT, STATE_DRESS_RETURNING), the sequence moves to X Clear, then Z Safe.
| GrinderODIDKaydonGUIModule MachineReset | ( | ) |
Reset all active grind state pound variables to their default cleared values.
Clears the three primary grind state control variables used by the Kaydon grinder cycle: pound variable 720 (dress/clean state flag), 700 (grind cycle state flag), and 550 (auxiliary grind flag). All three are set to 0 to ensure the machine returns to a neutral state after a reset event.
| GrinderODIDKaydonGUIModule PLCScript | ( | ) |
Execute the periodic PLC script update for the Kaydon OD/ID grinder screen.
Called on every PLC cycle to keep screen elements synchronized with machine state. Performs the following updates in order: