|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| TurnScreenV01 | MachineScreenLoadScript () |
| Initialize signal handlers for the Turn screen on load. | |
| TurnScreenV01 | MachineScreenPLCScript () |
| PLC script update function for the Turn screen. | |
| TurnScreenV01 | MachineScreenLowPriorityLoop () |
| Periodic low-priority screen update loop for the Turn screen. | |
| TurnScreenV01 | PositionDisplayUnLocked () |
| Switch the position display to Unlocked mode on the Turn screen. | |
| TurnScreenV01 | PositionDisplayLocked () |
| Switch the position display to Locked mode on the Turn screen. | |
| TurnScreenV01 | PositionDisplayDROMode () |
| Switch the position display to DRO mode on the Turn screen. | |
| TurnScreenV01 | UpdateDROPostions () |
| Update the DRO mode axis position displays on the Turn screen. | |
| TurnScreenV01 | UpdateFeedrateDROLabels () |
| Update the feedrate mode label and current velocity DRO on the Turn screen. | |
| TurnScreenV01 | OperatorPanelInitialization () |
| Initialize operator panel controls and configure DRO editability based on connected hardware. | |
| TurnScreenV01 | OnCannedCyclesPost () |
| Handle post-processing actions after a canned cycle is executed. | |
| TurnScreenV01 | UpdateDRODecimalCount () |
| Update the decimal precision format of all DRO controls on the Turn screen. | |
| TurnScreenV01 | UpdateOperatorPanelControls () |
| Update operator panel controls with current jog rate values. | |
| TurnScreenV01 | UpdateToolOffsetsTab () |
| Update the Tool Offsets tab UI controls based on OEM configuration parameters. | |
| TurnScreenV01 | UpdateToolPathPanels (Panel) |
| Update the visibility of tool path display panels on the Turn screen. | |
| TurnScreenV01 | UpdateAxisDROs () |
| Placeholder for axis DRO updates on the Turn screen. | |
| TurnScreenV01 | UpdateMBSequenceBitData () |
| Update PLC-controlled button states from Modbus sequence bit data. | |
| TurnScreenV01 MachineScreenLoadScript | ( | ) |
Initialize signal handlers for the Turn screen on load.
Registers screen signal library callbacks for all configured Mach4 instances. Currently registers a handler for mc.OSIG_TOOL_CHANGE which:
| TurnScreenV01 MachineScreenLowPriorityLoop | ( | ) |
Periodic low-priority screen update loop for the Turn screen.
Called repeatedly at low priority to refresh Turn-specific screen elements:
| TurnScreenV01 MachineScreenPLCScript | ( | ) |
PLC script update function for the Turn screen.
Called on every PLC cycle to perform Turn-specific PLC updates. Invokes TurnScreenV01.UpdateMBSequenceBitData() to refresh the state of PLC-controlled buttons such as Chuck and Tailstock.
| TurnScreenV01 OnCannedCyclesPost | ( | ) |
Handle post-processing actions after a canned cycle is executed.
Switches the main window tab to the first tab (index 0), then displays a "Please Wait" dialog with a 500ms time delay while showing a "Refreshing Controls..." message. After the delay, refreshes all button-type controls on the screen.
| TurnScreenV01 OperatorPanelInitialization | ( | ) |
Initialize operator panel controls and configure DRO editability based on connected hardware.
Detects which operator panels are configured via w.GetConfiguredOperatorPanels() and sets up the Rapid Override, Spindle Override, and Feedrate Override DROs as either editable or read-only accordingly:
| TurnScreenV01 PositionDisplayDROMode | ( | ) |
Switch the position display to DRO mode on the Turn screen.
Hides the Unlocked and Locked position display groups and shows the DRO position display group. Disables all tool offset, fixture offset, G52, and work shift offset UI groups. Sets the DRO mode button to green and clears other button colors. All axis and tool DROs are set to editable (Editor = "1"). Calls m.screen.InitializeAxisPositionGroup() to reinitialize axis display elements.
| TurnScreenV01 PositionDisplayLocked | ( | ) |
Switch the position display to Locked mode on the Turn screen.
Hides the Unlocked and DRO position display groups and shows the Locked position display group. Disables all tool offset, fixture offset, G52, and work shift offset UI groups. Sets all axis and tool DROs to read-only (Editor = "3"). Sets the Locked button to green and clears other button colors. After updating the UI, saves the tool file via mc.mcToolSaveFile() and saves fixture offsets via m.SaveFixtureOffsets(). Calls the optional user.UserPositionDisplayLocked hook if defined.
| TurnScreenV01 PositionDisplayUnLocked | ( | ) |
Switch the position display to Unlocked mode on the Turn screen.
Hides the Locked and DRO position display groups and shows the Unlocked position display group. Enables tool offset, fixture offset, G52, and work shift offset UI groups. Sets the Unlocked button to green and the position display mode button to yellow. The X axis DRO is locked (Editor = "3") while all other axis and tool DROs are set to editable (Editor = "1"). Enables the CalculateToolLengthBtn if the ToolSetterPositionType is "Fixed", or if CALCULATE_SETTER_POSITION is true for non-fixed types. Calls m.screen.InitializeAxisPositionGroup() and the optional user.UserPositionDisplayUnLocked hook.
| TurnScreenV01 UpdateAxisDROs | ( | ) |
Placeholder for axis DRO updates on the Turn screen.
This function is intentionally left empty as axis DRO updates are not required for the Turn screen configuration. It exists to satisfy the interface contract defined by the common screen module.
| TurnScreenV01 UpdateDRODecimalCount | ( | ) |
Update the decimal precision format of all DRO controls on the Turn screen.
Reads decimal count preferences from the Mach4 profile and applies format strings to feedrate, tool offset, and axis position DRO controls. Feedrate DROs use the "DecimalCountFeedrate" preference, tool DROs use "DecimalCountTool", and axis DROs (position, to-go, DRO mode, and machine position) use per-axis precision from mc.mcAxisGetPrecision(). Defaults to "4" if axis precision is nil or empty.
| TurnScreenV01 UpdateDROPostions | ( | ) |
Update the DRO mode axis position displays on the Turn screen.
When the DROPositionDisplayGroup is visible (Hidden == "0"), iterates over all coordinate axes and reads the machine position via mc.mcAxisGetMachinePos(). Applies the following transformations before displaying:
| TurnScreenV01 UpdateFeedrateDROLabels | ( | ) |
Update the feedrate mode label and current velocity DRO on the Turn screen.
Reads the current feedrate mode (G98/G99) from modal group 5 and updates the velocity unit label and current velocity DRO accordingly:
| TurnScreenV01 UpdateMBSequenceBitData | ( | ) |
Update PLC-controlled button states from Modbus sequence bit data.
Reads OEM parameter values for M10, M11, M25, and M26 PLC sequence numbers, then queries the Modbus device for the current bit state of each sequence. Updates the Chuck and Tailstock button colors and labels based on the retrieved bit states. If the mb.GetBit function is not available, no updates are performed.
| TurnScreenV01 UpdateOperatorPanelControls | ( | ) |
Update operator panel controls with current jog rate values.
If an operator panel is detected (OPERATOR_PANEL_STATUS == true), reads the "mm_JogRateCont" register from the MachMotion device and updates the JogSpeed screen control with the retrieved value.
| TurnScreenV01 UpdateToolOffsetsTab | ( | ) |
Update the Tool Offsets tab UI controls based on OEM configuration parameters.
Reads several OEM parameters (ToolSetterType, ManualGageBlockHeight, ToolSetterHeight, ToolSetterPositionType, ToolChangerMethod) and configures the visibility and enabled state of tool offset UI groups accordingly.
| TurnScreenV01 UpdateToolPathPanels | ( | Panel | ) |
Update the visibility of tool path display panels on the Turn screen.
Controls which tool path view panels are shown or hidden based on the specified panel number. Supports configurations of 0 (no panel), 1, 2, 3, or 4 simultaneous tool path views. If probing mode is active, forces Panel to 0 and shows the probing group. Sets the tool path view mode to "5" for ToolPathA(1).
| Panel | (number) The panel layout to display (0 = none, 1 = single, 2 = dual, 3 = triple, 4 = quad) |