|
Mach Modules Documentation
Lua Module API Documentation
|
Go to the source code of this file.
Functions | |
| GrinderSufaceAuxModule | IsSimModeActive () |
| Check whether the machine is currently running in simulation mode. | |
| GrinderSufaceAuxModule | RunSequence (sequence) |
| Run a PLC sequence without waiting for completion. | |
| GrinderSufaceAuxModule | RunSequenceWait (sequence) |
| Run a PLC sequence and block until it completes, with context-aware waiting. | |
| GrinderSufaceAuxModule | IsSequenceRunning (sequence) |
| Check whether a specified PLC sequence is currently running. | |
| GrinderSufaceAuxModule | IsXAxisHydraulic () |
| Check whether the X axis is configured as a hydraulic axis. | |
| GrinderSufaceAuxModule | IsZAxisHydraulic () |
| Check whether the Z axis is configured as a hydraulic axis. | |
| GrinderSufaceAuxModule | IsXPositiveStrokeActive () |
| Check whether the X axis positive stroke position sensor is currently active. | |
| GrinderSufaceAuxModule | IsXNegativeStrokeActive () |
| Check whether the X axis negative stroke position sensor is currently active. | |
| GrinderSufaceAuxModule | IsZPositiveStrokeActive () |
| Check whether the Z axis positive stroke position sensor is currently active. | |
| GrinderSufaceAuxModule | IsZNegativeStrokeActive () |
| Check whether the Z axis negative stroke position sensor is currently active. | |
| GrinderSufaceAuxModule | IsXPositiveParkActive () |
| Check whether the X axis positive park position sensor is currently active. | |
| GrinderSufaceAuxModule | IsXNegativeParkActive () |
| Check whether the X axis negative park position sensor is currently active. | |
| GrinderSufaceAuxModule | IsZPositiveParkActive () |
| Check whether the Z axis positive park position sensor is currently active. | |
| GrinderSufaceAuxModule | IsZNegativeParkActive () |
| Check whether the Z axis negative park position sensor is currently active. | |
| GrinderSufaceAuxModule | IsXParkOverrideActive () |
| Check whether the X axis park override is currently active. | |
| GrinderSufaceAuxModule | IsZParkOverrideActive () |
| Check whether the Z axis park override is currently active. | |
| GrinderSufaceAuxModule | SetXParkOverrideOn () |
| Activate the X axis park override by writing a true state to the PLC I/O bit. | |
| GrinderSufaceAuxModule | SetXParkOverrideOff () |
| Deactivate the X axis park override by writing a false state to the PLC I/O bit. | |
| GrinderSufaceAuxModule | SetZParkOverrideOn () |
| Activate the Z axis park override by writing a true state to the PLC I/O bit. | |
| GrinderSufaceAuxModule | SetZParkOverrideOff () |
| Deactivate the Z axis park override by writing a false state to the PLC I/O bit. | |
| GrinderSufaceAuxModule | XParkOverrideToggle () |
| Toggle the X axis park override state between active and inactive. | |
| GrinderSufaceAuxModule | ZParkOverrideToggle () |
| Toggle the Z axis park override state between active and inactive. | |
| GrinderSufaceAuxModule | SetXDefaultDirectionPositive () |
| Set the X axis default reciprocating direction to positive. | |
| GrinderSufaceAuxModule | SetXDefaultDirectionNegative () |
| Set the X axis default reciprocating direction to negative. | |
| GrinderSufaceAuxModule | IsXDefaultDirectionPositive () |
| Check whether the X axis default reciprocating direction is set to positive. | |
| GrinderSufaceAuxModule | SetXDefaultDirectionToggle () |
| Toggle the X axis default reciprocating direction between positive and negative. | |
| GrinderSufaceAuxModule | SetZDefaultDirectionPositive () |
| Set the Z axis default reciprocating direction to positive. | |
| GrinderSufaceAuxModule | SetZDefaultDirectionNegative () |
| Set the Z axis default reciprocating direction to negative. | |
| GrinderSufaceAuxModule | IsZDefaultDirectionPositive () |
| Check whether the Z axis default reciprocating direction is set to positive. | |
| GrinderSufaceAuxModule | SetZDefaultDirectionToggle () |
| Toggle the Z axis default reciprocating direction between positive and negative. | |
| GrinderSufaceAuxModule | SetXParkPositionPositive () |
| Set the X axis end-of-program park position to the positive direction. | |
| GrinderSufaceAuxModule | SetXParkPositionNegative () |
| Set the X axis end-of-program park position to the negative direction. | |
| GrinderSufaceAuxModule | IsXParkPositionPositive () |
| Check whether the X axis end-of-program park position is set to positive. | |
| GrinderSufaceAuxModule | SetZParkPositionPositive () |
| Set the Z axis end-of-program park position to the positive direction. | |
| GrinderSufaceAuxModule | SetZParkPositionNegative () |
| Set the Z axis end-of-program park position to the negative direction. | |
| GrinderSufaceAuxModule | IsZParkPositionPositive () |
| Check whether the Z axis end-of-program park position is set to positive. | |
| GrinderSufaceAuxModule | XAndZReset () |
| Reset both the X and Z axes simultaneously by running PLC sequences 0 and 10. | |
| GrinderSufaceAuxModule | XReset () |
| Reset the X axis by running PLC sequence 0 and waiting for completion. | |
| GrinderSufaceAuxModule | XReciprocatingToggle () |
| Toggle the X axis reciprocating state on or off. | |
| GrinderSufaceAuxModule | XStartReciprocating () |
| Start the X axis reciprocating sequence if it is not already running. | |
| GrinderSufaceAuxModule | IsXStartReciprocating () |
| Check whether the X axis reciprocating sequence is currently running. | |
| GrinderSufaceAuxModule | IsXManualControl () |
| Check whether the X axis is currently under manual control. | |
| GrinderSufaceAuxModule | XGoToPositiveStroke () |
| Command the X axis to move to the positive stroke position and wait for completion. | |
| GrinderSufaceAuxModule | IsXGoToPositiveStroke () |
| Check whether the X axis move-to-positive-stroke sequence is currently running. | |
| GrinderSufaceAuxModule | XGoToNegativeStroke () |
| Command the X axis to move to the negative stroke position and wait for completion. | |
| GrinderSufaceAuxModule | IsXGoToNegativeStroke () |
| Check whether the X axis move-to-negative-stroke sequence is currently running. | |
| GrinderSufaceAuxModule | XGoToPositivePark () |
| Command the X axis to move to the positive park position and wait for completion. | |
| GrinderSufaceAuxModule | IsXGoToPositivePark () |
| Check whether the X axis move-to-positive-park sequence is currently running. | |
| GrinderSufaceAuxModule | XGoToNegativePark () |
| Command the X axis to move to the negative park position and wait for completion. | |
| GrinderSufaceAuxModule | IsXGoToNegativePark () |
| Check whether the X axis move-to-negative-park sequence is currently running. | |
| GrinderSufaceAuxModule | XGoToDressPosition () |
| Command the X axis to move to the dresser position and wait for completion. | |
| GrinderSufaceAuxModule | IsXGoToDressPosition () |
| Check whether the X axis move-to-dress-position sequence is currently running. | |
| GrinderSufaceAuxModule | XHome () |
| Command the X axis to execute its homing sequence and wait for completion. | |
| GrinderSufaceAuxModule | IsXHoming () |
| Check whether the X axis homing sequence is currently running. | |
| GrinderSufaceAuxModule | SetXPositiveStrokePause (pause) |
| Set the X axis positive stroke pause (dwell) duration in the OEM parameter. | |
| GrinderSufaceAuxModule | SetXNegativeStrokePause (pause) |
| Set the X axis negative stroke pause (dwell) duration in the OEM parameter. | |
| GrinderSufaceAuxModule | TeachXPositiveTableStrokePosition () |
| Teach and record the X axis positive table stroke position via PLC sequence. | |
| GrinderSufaceAuxModule | TeachXNegativeTableStrokePosition () |
| Teach and record the X axis negative table stroke position via PLC sequence. | |
| GrinderSufaceAuxModule | TeachXPositiveTableParkPosition () |
| Teach and record the X axis positive table park position via PLC sequence. | |
| GrinderSufaceAuxModule | TeachXNegativeTableParkPosition () |
| Teach and record the X axis negative table park position via PLC sequence. | |
| GrinderSufaceAuxModule | ZReset () |
| Reset the Z axis by running PLC sequence 10 and waiting for completion. | |
| GrinderSufaceAuxModule | ZGoToPositiveStroke () |
| Command the Z axis to move to the positive stroke position and wait for completion. | |
| GrinderSufaceAuxModule | IsZGoToPositiveStroke () |
| Check whether the Z axis move-to-positive-stroke sequence is currently running. | |
| GrinderSufaceAuxModule | ZGoToNegativeStroke () |
| Command the Z axis to move to the negative stroke position and wait for completion. | |
| GrinderSufaceAuxModule | IsZGoToNegativeStroke () |
| Check whether the Z axis move-to-negative-stroke sequence is currently running. | |
| GrinderSufaceAuxModule | ZGoToPositivePark () |
| Command the Z axis to move to the positive park position and wait for completion. | |
| GrinderSufaceAuxModule | IsZGoToPositivePark () |
| Check whether the Z axis move-to-positive-park sequence is currently running. | |
| GrinderSufaceAuxModule | ZGoToNegativePark () |
| Command the Z axis to move to the negative park position and wait for completion. | |
| GrinderSufaceAuxModule | IsZGoToNegativePark () |
| Check whether the Z axis move-to-negative-park sequence is currently running. | |
| GrinderSufaceAuxModule | StartCrossover () |
| Start the Z axis crossover sequence and wait for completion. | |
| GrinderSufaceAuxModule | IsStartCrossover () |
| Check whether the Z axis crossover sequence is currently running. | |
| GrinderSufaceAuxModule | ZHome () |
| Command the Z axis to execute its homing sequence and wait for completion. | |
| GrinderSufaceAuxModule | IsZHoming () |
| Check whether the Z axis homing sequence is currently running. | |
| GrinderSufaceAuxModule | SetZPositiveStrokePause (pause) |
| Set the Z axis positive stroke pause (dwell) duration in the OEM parameter. | |
| GrinderSufaceAuxModule | SetZNegativeStrokePause (pause) |
| Set the Z axis negative stroke pause (dwell) duration in the OEM parameter. | |
| GrinderSufaceAuxModule | SetZPositiveStrokePick (pick) |
| Set the Z axis positive stroke pick (incremental feed) value in the OEM parameter. | |
| GrinderSufaceAuxModule | SetZNegativeStrokePick (pick) |
| Set the Z axis negative stroke pick (incremental feed) value in the OEM parameter. | |
| GrinderSufaceAuxModule | GetWheelAttributes () |
| Retrieve the wheel attributes configuration table for the grinding wheel. | |
| GrinderSufaceAuxModule | SetTableSpeed (feedrate) |
| Set the table feedrate speed in both OEM parameters and PLC registers. | |
| GrinderSufaceAuxModule | SetXPositiveStrokePosition (position) |
| Set the X axis positive stroke position in both OEM parameters and PLC registers. | |
| GrinderSufaceAuxModule | SetXNegativeStrokePosition (position) |
| Set the X axis negative stroke position in both OEM parameters and PLC registers. | |
| GrinderSufaceAuxModule | GetPLCObjects () |
| Retrieve the PLC objects configuration table for the Surface Grinder. | |
| GrinderSufaceAuxModule GetPLCObjects | ( | ) |
Retrieve the PLC objects configuration table for the Surface Grinder.
Returns a comprehensive nested table describing all PLC I/O points, control registers, and PLC registers used by the Surface Grinder. The table includes device names, axis definitions for X and Z axes, control bit mappings, and register mappings for both OEM parameters and PLC data registers. This table is used throughout the module to resolve I/O names and register paths. The structure includes:
| GrinderSufaceAuxModule GetWheelAttributes | ( | ) |
Retrieve the wheel attributes configuration table for the grinding wheel.
Returns a table of name-parameter number pairs describing all grinding wheel attributes stored in OEM parameters. Each entry is a two-element array of the form {attribute_name, parameter_number}. Attributes include wheel geometry (diameter, width), safety positions, dress positions (up to 3 dresser positions for X, Y, Z), SFM settings, rotary dresser parameters, and dresser user offsets.
| GrinderSufaceAuxModule IsSequenceRunning | ( | sequence | ) |
Check whether a specified PLC sequence is currently running.
Returns false immediately if sim mode is active. Otherwise delegates to mb.IsSeqRunning() on PLCDevice 0 to query whether the specified sequence number is active.
| sequence | (number) The PLC sequence number to check |
| GrinderSufaceAuxModule IsSimModeActive | ( | ) |
Check whether the machine is currently running in simulation mode.
Compares the MotionDevice profile string (read at module load time) against the known simulation device names 'Sim0' and 'SimDev0'. Returns true if either matches, indicating that no real motion hardware is present and PLC sequence calls should be skipped.
| GrinderSufaceAuxModule IsStartCrossover | ( | ) |
Check whether the Z axis crossover sequence is currently running.
| GrinderSufaceAuxModule IsXAxisHydraulic | ( | ) |
Check whether the X axis is configured as a hydraulic axis.
Reads bit 0 of OEM parameter 1901 via the cached parameter bit reader. Returns true if the bit value equals 0, indicating hydraulic control; a non-zero value indicates servo control.
| GrinderSufaceAuxModule IsXDefaultDirectionPositive | ( | ) |
Check whether the X axis default reciprocating direction is set to positive.
Reads the PLC I/O bit 'X-Default-DIR' from the Control IO_0 register via w.GetIoState(). Returns the IO state value directly. Calls w.FunctionError() if the read fails but still returns the iostate value.
| GrinderSufaceAuxModule IsXGoToDressPosition | ( | ) |
Check whether the X axis move-to-dress-position sequence is currently running.
| GrinderSufaceAuxModule IsXGoToNegativePark | ( | ) |
Check whether the X axis move-to-negative-park sequence is currently running.
| GrinderSufaceAuxModule IsXGoToNegativeStroke | ( | ) |
Check whether the X axis move-to-negative-stroke sequence is currently running.
| GrinderSufaceAuxModule IsXGoToPositivePark | ( | ) |
Check whether the X axis move-to-positive-park sequence is currently running.
| GrinderSufaceAuxModule IsXGoToPositiveStroke | ( | ) |
Check whether the X axis move-to-positive-stroke sequence is currently running.
| GrinderSufaceAuxModule IsXHoming | ( | ) |
Check whether the X axis homing sequence is currently running.
| GrinderSufaceAuxModule IsXManualControl | ( | ) |
Check whether the X axis is currently under manual control.
Reads the OEM parameter string 'XAxisIsManuallyControlled' and returns true if the value equals 'Yes'. When manual control is active, automated sequence commands for the X axis are skipped and return immediately with success.
| GrinderSufaceAuxModule IsXNegativeParkActive | ( | ) |
Check whether the X axis negative park position sensor is currently active.
Retrieves the I/O name for the X negative park signal from bit 6 of X IO_0 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsXNegativeStrokeActive | ( | ) |
Check whether the X axis negative stroke position sensor is currently active.
Retrieves the I/O name for the X negative stroke signal from bit 5 of X IO_0 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsXParkOverrideActive | ( | ) |
Check whether the X axis park override is currently active.
Retrieves the I/O name for the X park override from bit 1 of Control IO_1 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsXParkPositionPositive | ( | ) |
Check whether the X axis end-of-program park position is set to positive.
Reads bit 0 of OEM parameter 1903 via the cached parameter bit reader. Returns true if the bit value equals 1 (positive park direction), false otherwise.
| GrinderSufaceAuxModule IsXPositiveParkActive | ( | ) |
Check whether the X axis positive park position sensor is currently active.
Retrieves the I/O name for the X positive park signal from bit 3 of X IO_0 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsXPositiveStrokeActive | ( | ) |
Check whether the X axis positive stroke position sensor is currently active.
Retrieves the I/O name for the X positive stroke signal from bit 4 of X IO_0 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsXStartReciprocating | ( | ) |
Check whether the X axis reciprocating sequence is currently running.
| GrinderSufaceAuxModule IsZAxisHydraulic | ( | ) |
Check whether the Z axis is configured as a hydraulic axis.
Reads bit 0 of OEM parameter 1902 via the cached parameter bit reader. Returns true if the bit value equals 0, indicating hydraulic control; a non-zero value indicates servo control.
| GrinderSufaceAuxModule IsZDefaultDirectionPositive | ( | ) |
Check whether the Z axis default reciprocating direction is set to positive.
Reads the PLC I/O bit 'Z-Default-DIR' from the Control IO_0 register via w.GetIoState(). Returns the IO state value directly. Calls w.FunctionError() if the read fails but still returns the iostate value.
| GrinderSufaceAuxModule IsZGoToNegativePark | ( | ) |
Check whether the Z axis move-to-negative-park sequence is currently running.
| GrinderSufaceAuxModule IsZGoToNegativeStroke | ( | ) |
Check whether the Z axis move-to-negative-stroke sequence is currently running.
| GrinderSufaceAuxModule IsZGoToPositivePark | ( | ) |
Check whether the Z axis move-to-positive-park sequence is currently running.
| GrinderSufaceAuxModule IsZGoToPositiveStroke | ( | ) |
Check whether the Z axis move-to-positive-stroke sequence is currently running.
| GrinderSufaceAuxModule IsZHoming | ( | ) |
Check whether the Z axis homing sequence is currently running.
| inst | (number) The Mach4 instance handle. If not provided, uses current instance |
| GrinderSufaceAuxModule IsZNegativeParkActive | ( | ) |
Check whether the Z axis negative park position sensor is currently active.
Retrieves the I/O name for the Z negative park signal from bit 6 of Z IO_0 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsZNegativeStrokeActive | ( | ) |
Check whether the Z axis negative stroke position sensor is currently active.
Retrieves the I/O name for the Z negative stroke signal from bit 5 of Z IO_0 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsZParkOverrideActive | ( | ) |
Check whether the Z axis park override is currently active.
Retrieves the I/O name for the Z park override from bit 2 of Control IO_1 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsZParkPositionPositive | ( | ) |
Check whether the Z axis end-of-program park position is set to positive.
Reads bit 0 of OEM parameter 1904 via the cached parameter bit reader. Returns true if the bit value equals 1 (positive park direction), false otherwise.
| GrinderSufaceAuxModule IsZPositiveParkActive | ( | ) |
Check whether the Z axis positive park position sensor is currently active.
Retrieves the I/O name for the Z positive park signal from bit 3 of Z IO_0 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule IsZPositiveStrokeActive | ( | ) |
Check whether the Z axis positive stroke position sensor is currently active.
Retrieves the I/O name for the Z positive stroke signal from bit 4 of Z IO_0 via GetPLCObjects(), then reads its current state via w.GetIoState().
| GrinderSufaceAuxModule RunSequence | ( | sequence | ) |
Run a PLC sequence without waiting for completion.
If sim mode is active, returns immediately with a success message. For hydraulic X axis configurations, invokes mb.SeqCallWrapper() to start the specified sequence on PLCDevice 0. For non-hydraulic configurations, writes the sequence number to the OEM parameter 'TableStrokeRunCommand' via w.SetOEMParamValue(). Returns an error tuple if any step fails.
| sequence | (number|table) The PLC sequence number or array of sequence numbers to run |
| GrinderSufaceAuxModule RunSequenceWait | ( | sequence | ) |
Run a PLC sequence and block until it completes, with context-aware waiting.
If sim mode is active, returns immediately with a success message. For hydraulic X axis configurations, invokes mb.SeqCallWrapper() to start the sequence, then waits for completion using either a PleaseWaitDialog (when running in a screen chunk) or mb.SeqWaitWrapper() (when running in an M-code chunk). For non-hydraulic configurations, writes the sequence number to the OEM parameter 'TableStrokeRunCommand' via w.SetOEMParamValue(). Returns an error tuple if any step fails.
| sequence | (number|table) The PLC sequence number or array of sequence numbers to run |
| GrinderSufaceAuxModule SetTableSpeed | ( | feedrate | ) |
Set the table feedrate speed in both OEM parameters and PLC registers.
Writes the specified feedrate value to the OEM parameter register 'XTableSpeed' and simultaneously writes a scaled value (feedrate * 10) to the corresponding PLC register 'ContData3' via the Modbus device. Both values are updated atomically to keep OEM and PLC state synchronized.
| feedrate | (number) The table speed feedrate value in machine units per minute |
| GrinderSufaceAuxModule SetXDefaultDirectionNegative | ( | ) |
Set the X axis default reciprocating direction to negative.
Writes a true state to the PLC I/O bit 'X-Default-DIR' (bit 1 of Control IO_0) via w.SetIoState(). A true state on this bit corresponds to the negative default direction. Calls w.FunctionError() on failure and w.FunctionCompleted() on success.
| GrinderSufaceAuxModule SetXDefaultDirectionPositive | ( | ) |
Set the X axis default reciprocating direction to positive.
Writes a false state to the PLC I/O bit 'X-Default-DIR' (bit 1 of Control IO_0) via w.SetIoState(). A false state on this bit corresponds to the positive default direction. Calls w.FunctionError() on failure and w.FunctionCompleted() on success.
| GrinderSufaceAuxModule SetXDefaultDirectionToggle | ( | ) |
Toggle the X axis default reciprocating direction between positive and negative.
Reads the current X default direction state via IsXDefaultDirectionPositive(). If currently positive, sets the direction to negative; otherwise sets it to positive. Calls w.FunctionCompleted() upon finishing the toggle.
| GrinderSufaceAuxModule SetXNegativeStrokePause | ( | pause | ) |
Set the X axis negative stroke pause (dwell) duration in the OEM parameter.
Writes the specified pause duration to the OEM parameter 'XNegativePause'. Returns an error tuple if the write fails.
| pause | (number) The X negative stroke pause duration in milliseconds |
References pause().
| GrinderSufaceAuxModule SetXNegativeStrokePosition | ( | position | ) |
Set the X axis negative stroke position in both OEM parameters and PLC registers.
Writes the specified position value to the OEM parameter register and simultaneously writes a scaled value (position * 100) to the corresponding PLC register via the Modbus device. The OEM register used is 'XStrokePositionNEG' and the PLC register is 'ContDataDouble1'.
| position | (number) The negative stroke position value in machine units |
| GrinderSufaceAuxModule SetXParkOverrideOff | ( | ) |
Deactivate the X axis park override by writing a false state to the PLC I/O bit.
Retrieves the I/O name for the X park override from bit 1 of Control IO_1 via GetPLCObjects(), then writes a false state to it via w.SetIoState(). Calls w.FunctionError() on failure and w.FunctionCompleted() on success.
| GrinderSufaceAuxModule SetXParkOverrideOn | ( | ) |
Activate the X axis park override by writing a true state to the PLC I/O bit.
Retrieves the I/O name for the X park override from bit 1 of Control IO_1 via GetPLCObjects(), then writes a true state to it via w.SetIoState(). Calls w.FunctionError() on failure and w.FunctionCompleted() on success.
| GrinderSufaceAuxModule SetXParkPositionNegative | ( | ) |
Set the X axis end-of-program park position to the negative direction.
Clears bit 0 of OEM parameter 1903 to configure the X axis to park in the negative direction at the end of a program.
| GrinderSufaceAuxModule SetXParkPositionPositive | ( | ) |
Set the X axis end-of-program park position to the positive direction.
Sets bit 0 of OEM parameter 1903 to configure the X axis to park in the positive direction at the end of a program.
| GrinderSufaceAuxModule SetXPositiveStrokePause | ( | pause | ) |
Set the X axis positive stroke pause (dwell) duration in the OEM parameter.
Writes the specified pause duration to the OEM parameter 'XPositivePause'. Returns an error tuple if the write fails.
| pause | (number) The X positive stroke pause duration in milliseconds |
References pause().
| GrinderSufaceAuxModule SetXPositiveStrokePosition | ( | position | ) |
Set the X axis positive stroke position in both OEM parameters and PLC registers.
Writes the specified position value to the OEM parameter register and simultaneously writes a scaled value (position * 100) to the corresponding PLC register via the Modbus device. The OEM register used is 'XStrokePositionPOS' and the PLC register is 'ContDataDouble0'.
| position | (number) The positive stroke position value in machine units |
| GrinderSufaceAuxModule SetZDefaultDirectionNegative | ( | ) |
Set the Z axis default reciprocating direction to negative.
Writes a true state to the PLC I/O bit 'Z-Default-DIR' (bit 2 of Control IO_0) via w.SetIoState(). A true state on this bit corresponds to the negative default direction. Calls w.FunctionError() on failure and w.FunctionCompleted() on success.
| GrinderSufaceAuxModule SetZDefaultDirectionPositive | ( | ) |
Set the Z axis default reciprocating direction to positive.
Writes a false state to the PLC I/O bit 'Z-Default-DIR' (bit 2 of Control IO_0) via w.SetIoState(). A false state on this bit corresponds to the positive default direction. Calls w.FunctionError() on failure and w.FunctionCompleted() on success.
| GrinderSufaceAuxModule SetZDefaultDirectionToggle | ( | ) |
Toggle the Z axis default reciprocating direction between positive and negative.
Reads the current Z default direction state via IsZDefaultDirectionPositive(). If currently positive, sets the direction to negative; otherwise sets it to positive. Calls w.FunctionCompleted() upon finishing the toggle.
| GrinderSufaceAuxModule SetZNegativeStrokePause | ( | pause | ) |
Set the Z axis negative stroke pause (dwell) duration in the OEM parameter.
Writes the specified pause duration to the OEM parameter 'XNegativePause'. Returns an error tuple if the write fails.
| pause | (number) The Z negative stroke pause duration in milliseconds |
References pause().
| GrinderSufaceAuxModule SetZNegativeStrokePick | ( | pick | ) |
Set the Z axis negative stroke pick (incremental feed) value in the OEM parameter.
Writes the specified pick value to the OEM parameter 'ZNegativePick'. Returns an error tuple if the write fails.
| pick | (number) The Z negative stroke pick increment value in machine units |
| GrinderSufaceAuxModule SetZParkOverrideOff | ( | ) |
Deactivate the Z axis park override by writing a false state to the PLC I/O bit.
Retrieves the I/O name for the Z park override from bit 2 of Control IO_1 via GetPLCObjects(), then writes a false state to it via w.SetIoState(). Calls w.FunctionError() on failure and w.FunctionCompleted() on success.
| GrinderSufaceAuxModule SetZParkOverrideOn | ( | ) |
Activate the Z axis park override by writing a true state to the PLC I/O bit.
Retrieves the I/O name for the Z park override from bit 2 of Control IO_1 via GetPLCObjects(), then writes a true state to it via w.SetIoState(). Calls w.FunctionError() on failure and w.FunctionCompleted() on success.
| GrinderSufaceAuxModule SetZParkPositionNegative | ( | ) |
Set the Z axis end-of-program park position to the negative direction.
Clears bit 0 of OEM parameter 1904 to configure the Z axis to park in the negative direction at the end of a program.
| GrinderSufaceAuxModule SetZParkPositionPositive | ( | ) |
Set the Z axis end-of-program park position to the positive direction.
Sets bit 0 of OEM parameter 1904 to configure the Z axis to park in the positive direction at the end of a program.
| GrinderSufaceAuxModule SetZPositiveStrokePause | ( | pause | ) |
Set the Z axis positive stroke pause (dwell) duration in the OEM parameter.
Writes the specified pause duration to the OEM parameter 'XPositivePause'. Returns an error tuple if the write fails.
| pause | (number) The Z positive stroke pause duration in milliseconds |
References pause().
| GrinderSufaceAuxModule SetZPositiveStrokePick | ( | pick | ) |
Set the Z axis positive stroke pick (incremental feed) value in the OEM parameter.
Writes the specified pick value to the OEM parameter 'ZPositivePick'. Returns an error tuple if the write fails.
| pick | (number) The Z positive stroke pick increment value in machine units |
| GrinderSufaceAuxModule StartCrossover | ( | ) |
Start the Z axis crossover sequence and wait for completion.
If the Z axis is not currently at either the positive or negative stroke position, the function first commands the Z axis to the positive stroke position before initiating the crossover sequence (sequence 17). Waits for the crossover sequence to complete before returning. Returns an error tuple if any step fails.
| GrinderSufaceAuxModule TeachXNegativeTableParkPosition | ( | ) |
Teach and record the X axis negative table park position via PLC sequence.
Runs PLC sequence 37 to move the X axis to the negative park position, then reads the encoder position from the Modbus register 'PLCData4' and logs it to the operator log.
| GrinderSufaceAuxModule TeachXNegativeTableStrokePosition | ( | ) |
Teach and record the X axis negative table stroke position via PLC sequence.
Runs PLC sequence 35 to move the X axis to the negative stroke position, then reads the encoder position from the Modbus register 'PLCData4' and logs it to the operator log.
| GrinderSufaceAuxModule TeachXPositiveTableParkPosition | ( | ) |
Teach and record the X axis positive table park position via PLC sequence.
Runs PLC sequence 36 to move the X axis to the positive park position, then reads the encoder position from the Modbus register 'PLCData4' and logs it to the operator log.
| GrinderSufaceAuxModule TeachXPositiveTableStrokePosition | ( | ) |
Teach and record the X axis positive table stroke position via PLC sequence.
Runs PLC sequence 34 to move the X axis to the positive stroke position, then reads the encoder position from the Modbus register 'PLCData4' and logs it to the operator log.
| GrinderSufaceAuxModule XAndZReset | ( | ) |
Reset both the X and Z axes simultaneously by running PLC sequences 0 and 10.
Runs PLC sequences 0 and 10 together via RunSequence({0,10}) and waits for completion. Returns an error tuple if sim mode is active or the sequence fails.
| GrinderSufaceAuxModule XGoToDressPosition | ( | ) |
Command the X axis to move to the dresser position and wait for completion.
If the X axis is in manual control mode, returns immediately with success. Reads the OEM parameter 'AutoTableDresserDirection' to determine which PLC sequence to run: sequence 6 for 'Positive' direction, or sequence 7 for any other direction. Waits for the selected sequence to complete before returning.
| GrinderSufaceAuxModule XGoToNegativePark | ( | ) |
Command the X axis to move to the negative park position and wait for completion.
If the X axis is in manual control mode, returns immediately with success. Otherwise runs PLC sequence 5 and waits for it to complete before returning. Returns an error tuple if the sequence fails.
| GrinderSufaceAuxModule XGoToNegativeStroke | ( | ) |
Command the X axis to move to the negative stroke position and wait for completion.
If the X axis is in manual control mode, returns immediately with success. Otherwise runs PLC sequence 3 and waits for it to complete before returning. Returns an error tuple if the sequence fails.
| GrinderSufaceAuxModule XGoToPositivePark | ( | ) |
Command the X axis to move to the positive park position and wait for completion.
If the X axis is in manual control mode, returns immediately with success. Otherwise runs PLC sequence 4 and waits for it to complete before returning. Returns an error tuple if the sequence fails.
| GrinderSufaceAuxModule XGoToPositiveStroke | ( | ) |
Command the X axis to move to the positive stroke position and wait for completion.
If the X axis is in manual control mode, returns immediately with success. Otherwise runs PLC sequence 2 and waits for it to complete before returning. Returns an error tuple if the sequence fails.
| GrinderSufaceAuxModule XHome | ( | ) |
Command the X axis to execute its homing sequence and wait for completion.
Checks if the X axis is in manual control mode and returns early if so. Reads the OEM parameter 'HydraulicAxesNeedsToBeHomed' and skips homing if the value is not 'Yes'. Otherwise runs PLC sequence 8 and waits for it to complete before returning.
| GrinderSufaceAuxModule XParkOverrideToggle | ( | ) |
Toggle the X axis park override state between active and inactive.
Reads the current X park override state via IsXParkOverrideActive(). If the override is currently active, calls SetXParkOverrideOff() to deactivate it; otherwise calls SetXParkOverrideOn() to activate it. Calls w.FunctionCompleted() upon finishing the toggle.
| GrinderSufaceAuxModule XReciprocatingToggle | ( | ) |
Toggle the X axis reciprocating state on or off.
If the X axis reciprocating sequence is currently running, calls XReset() to stop it. Otherwise calls XStartReciprocating() to begin the reciprocating cycle.
| GrinderSufaceAuxModule XReset | ( | ) |
Reset the X axis by running PLC sequence 0 and waiting for completion.
Runs PLC sequence 0 via RunSequence() and returns an error tuple if the sequence fails. On success, returns a completion tuple.
| GrinderSufaceAuxModule XStartReciprocating | ( | ) |
Start the X axis reciprocating sequence if it is not already running.
Checks whether the X axis reciprocating sequence (sequence 1) is already active. If not, runs PLC sequence 1 via RunSequence(). Returns immediately with success if the sequence is already running. Returns an error tuple if the sequence fails to start.
| GrinderSufaceAuxModule ZGoToNegativePark | ( | ) |
Command the Z axis to move to the negative park position and wait for completion.
Runs PLC sequence 15 and waits for it to complete before returning. Returns an error tuple if sim mode is active or the sequence fails.
| GrinderSufaceAuxModule ZGoToNegativeStroke | ( | ) |
Command the Z axis to move to the negative stroke position and wait for completion.
Runs PLC sequence 13 and waits for it to complete before returning. Returns an error tuple if sim mode is active or the sequence fails.
| GrinderSufaceAuxModule ZGoToPositivePark | ( | ) |
Command the Z axis to move to the positive park position and wait for completion.
Runs PLC sequence 14 and waits for it to complete before returning. Returns an error tuple if sim mode is active or the sequence fails.
| GrinderSufaceAuxModule ZGoToPositiveStroke | ( | ) |
Command the Z axis to move to the positive stroke position and wait for completion.
Runs PLC sequence 12 and waits for it to complete before returning. Returns an error tuple if sim mode is active or the sequence fails.
| GrinderSufaceAuxModule ZHome | ( | ) |
Command the Z axis to execute its homing sequence and wait for completion.
Runs PLC sequence 18 and waits for it to complete before returning. If sim mode is active or the sequence fails, returns an error tuple. On success, returns a completion tuple.
| GrinderSufaceAuxModule ZParkOverrideToggle | ( | ) |
Toggle the Z axis park override state between active and inactive.
Reads the current Z park override state via IsZParkOverrideActive(). If the override is currently active, calls SetZParkOverrideOff() to deactivate it; otherwise calls SetZParkOverrideOn() to activate it. Calls w.FunctionCompleted() upon finishing the toggle.
| GrinderSufaceAuxModule ZReset | ( | ) |
Reset the Z axis by running PLC sequence 10 and waiting for completion.
Runs PLC sequence 10 and waits for it to complete before returning. Returns an error tuple if sim mode is active or the sequence fails.