|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| MillGUIModule | ScreenLoadScript () |
| Execute mill module initialization tasks when the screen Lua environment first loads. | |
| MillGUIModule | StartUpScript () |
| Execute mill-specific startup initialization after the screen has loaded. | |
| MillGUIModule | ConfigureToolSizeEntryMode () |
| Read the ToolSizeEntryMode OEM parameter and apply it to the tool size entry configuration. | |
| MillGUIModule | PLCScript () |
| Execute periodic PLC cycle updates for the mill screen. | |
| MillGUIModule | LowPriorityLoop () |
| Execute low-priority periodic updates for the mill screen. | |
| MillGUIModule | RetractDialog () |
| Display a modal dialog for the user to select a retract position and return the selection. | |
| UI | CloseDialog () |
| Save the current radio box selection and destroy the retract positions dialog. | |
| MillGUIModule | IsRetractActive () |
| Check if the retract dialog should be shown and process the user's position selection. | |
| MillGUIModule | InitializeToolChangers () |
| Initialize tool changer outputs and configure GMS monitors for spindle and air pressure. | |
| MillGUIModule | UpdateToolReleaseButtonIndicator () |
| Update the TC_ToolReleaseButtonIndicatorOutput signal based on current machine state. | |
| MillGUIModule | MachineSpindleStateChanged () |
| Update the tool release button indicator output when the spindle state changes. | |
| MillGUIModule | InitializeSpindleToolRelease () |
| Configure the TC_ToolReleaseButtonIndicatorOutput signal to be ignored during disable and stop events. | |
| MillGUIModule | ToolReleaseButtonInputChanged (sig_state, idx, inst) |
| Handle a change in the tool release button input signal state. | |
| UI CloseDialog | ( | ) |
Save the current radio box selection and destroy the retract positions dialog.
Reads the currently selected position index from the radio box, writes it to the MachMotion profile under "LastGoToRetractPositionType" so it is restored on the next dialog open, stops the dialog's timer if running, and destroys the dialog window.
| MillGUIModule ConfigureToolSizeEntryMode | ( | ) |
Read the ToolSizeEntryMode OEM parameter and apply it to the tool size entry configuration.
Retrieves the "ToolSizeEntryMode" OEM parameter string value. If the parameter is found, calls m.SetToolSizeEntryMode() with the retrieved value using a protected call (w.pcall). If SetToolSizeEntryMode() raises an error, the error is logged to the Mach4 controller log via mc.mcCntlLog() with the context identifier "MillGUIModule".
| MillGUIModule InitializeSpindleToolRelease | ( | ) |
Configure the TC_ToolReleaseButtonIndicatorOutput signal to be ignored during disable and stop events.
If the TC_ToolReleaseButtonIndicatorOutput OEM parameter signal is mapped, adds it to the output ignore list for IgnoreOutputsOnDisable, IgnoreOutputsOnStop, and IgnoreOutputsOnEmergencyStop events. This prevents the indicator output from being automatically deactivated when the machine is disabled or stopped.
| MillGUIModule InitializeToolChangers | ( | ) |
Initialize tool changer outputs and configure GMS monitors for spindle and air pressure.
Performs the following initialization steps:
| MillGUIModule IsRetractActive | ( | ) |
Check if the retract dialog should be shown and process the user's position selection.
Checks the RetractEnabled and RetractGoToPositionEnabled OEM parameters. If both are "Yes", monitors the RetractDialog OEM register. When the register value is "OpenRetactDialog" (note: original spelling retained), opens the RetractDialog() to let the user select a retract position, then writes the selected position name back to the RetractDialog register so that M235 can act on the user's choice. This function is called from PLCScript on every PLC cycle.
| MillGUIModule LowPriorityLoop | ( | ) |
Execute low-priority periodic updates for the mill screen.
Called on a low-priority loop to perform UI refresh tasks that do not need to run every PLC cycle. Performs the following updates:
| MillGUIModule MachineSpindleStateChanged | ( | ) |
Update the tool release button indicator output when the spindle state changes.
Called as a hook when the machine spindle state changes. Delegates to UpdateToolReleaseButtonIndicator() to refresh the TC_ToolReleaseButtonIndicatorOutput signal.
| MillGUIModule PLCScript | ( | ) |
Execute periodic PLC cycle updates for the mill screen.
Called every PLC cycle to perform real-time UI and machine state updates. Performs the following tasks:
| MillGUIModule RetractDialog | ( | ) |
Display a modal dialog for the user to select a retract position and return the selection.
Retrieves the list of configured go-to positions via w.GetConfiguredGoToPositions(). If no positions are configured, substitutes a placeholder entry. Builds a radio box dialog presenting the configured position names and restores the last selection from the MachMotion profile key "LastGoToRetractPositionType". The dialog includes "Move" and "Stay" buttons:
| MillGUIModule ScreenLoadScript | ( | ) |
Execute mill module initialization tasks when the screen Lua environment first loads.
Called once when the screen script is first loaded. Performs the following tasks:
| MillGUIModule StartUpScript | ( | ) |
Execute mill-specific startup initialization after the screen has loaded.
Called during the startup sequence to configure mill hardware and UI elements. Performs the following initialization steps in order:
| MillGUIModule ToolReleaseButtonInputChanged | ( | sig_state | , |
| idx | , | ||
| inst | ) |
Handle a change in the tool release button input signal state.
Called when the TC_ToolReleaseButtonInput signal changes state. On a rising edge (sig_state true), calls ToolRelease() to open the draw bar. On a falling edge (sig_state false), calls ToolClamp() to close the draw bar. The idx parameter identifies which spindle's button input triggered the event.
| sig_state | (boolean) The new state of the tool release button input signal |
| idx | (number) The spindle index associated with the button that changed state |
| inst | (number) The Mach4 instance handle. If not provided, uses selected instance |
| MillGUIModule UpdateToolReleaseButtonIndicator | ( | ) |
Update the TC_ToolReleaseButtonIndicatorOutput signal based on current machine state.
If the TC_ToolReleaseButtonIndicatorOutput OEM parameter signal is mapped, computes the desired indicator state and updates the output only if it has changed. The indicator is active (true) when all of the following conditions are met: