Mach Modules Documentation
Lua Module API Documentation
Loading...
Searching...
No Matches
GrinderSufaceAuxModule.lua File Reference

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.

Function Documentation

◆ GetPLCObjects()

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:

  • MachDeviceName: The Mach4 device name ('SurfaceGrinder')
  • ModbusDeviceName: The Modbus device name ('modbus0')
  • X/Z axis I/O bit definitions for stroke, park, pause, and direction signals
  • Control I/O bits for jog directions, park overrides, and feed control
  • Control-Registers mapping OEM parameter names to PLC register names
  • PLC-Registers for table position feedback
    Returns
    (table) Nested configuration table containing all PLC object definitions for the grinder
    Note
    Documentation generated by AI on 2026-03-03

◆ GetWheelAttributes()

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.

Returns
(table) Array of {string, number} pairs mapping attribute names to OEM parameter numbers
Note
This table must be kept in sync with the t.mcs macro used during tool changes
Documentation generated by AI on 2026-03-03

◆ IsSequenceRunning()

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.

Parameters
sequence(number) The PLC sequence number to check
Returns
(boolean) True if the specified sequence is currently running, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsSimModeActive()

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.

Returns
(boolean) True if simulation mode is active, false if real hardware is connected
Note
Documentation generated by AI on 2026-03-03

◆ IsStartCrossover()

GrinderSufaceAuxModule IsStartCrossover ( )

Check whether the Z axis crossover sequence is currently running.

Returns
(boolean) True if crossover sequence (sequence 17) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXAxisHydraulic()

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.

Returns
(boolean) True if the X axis is hydraulic, false if servo-controlled
Note
Documentation generated by AI on 2026-03-03

◆ IsXDefaultDirectionPositive()

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.

Returns
(boolean) True if the X axis default direction is positive, false if negative
Note
Documentation generated by AI on 2026-03-03

◆ IsXGoToDressPosition()

GrinderSufaceAuxModule IsXGoToDressPosition ( )

Check whether the X axis move-to-dress-position sequence is currently running.

Returns
(boolean) True if X dress position sequence (sequence 6) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXGoToNegativePark()

GrinderSufaceAuxModule IsXGoToNegativePark ( )

Check whether the X axis move-to-negative-park sequence is currently running.

Returns
(boolean) True if X negative park sequence (sequence 5) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXGoToNegativeStroke()

GrinderSufaceAuxModule IsXGoToNegativeStroke ( )

Check whether the X axis move-to-negative-stroke sequence is currently running.

Returns
(boolean) True if X negative stroke sequence (sequence 3) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXGoToPositivePark()

GrinderSufaceAuxModule IsXGoToPositivePark ( )

Check whether the X axis move-to-positive-park sequence is currently running.

Returns
(boolean) True if X positive park sequence (sequence 4) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXGoToPositiveStroke()

GrinderSufaceAuxModule IsXGoToPositiveStroke ( )

Check whether the X axis move-to-positive-stroke sequence is currently running.

Returns
(boolean) True if X positive stroke sequence (sequence 2) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXHoming()

GrinderSufaceAuxModule IsXHoming ( )

Check whether the X axis homing sequence is currently running.

Returns
(boolean) True if X axis homing sequence (sequence 8) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXManualControl()

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.

Returns
(boolean) True if the X axis is in manual control mode, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXNegativeParkActive()

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().

Returns
(boolean) True if the X axis negative park position sensor is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXNegativeStrokeActive()

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().

Returns
(boolean) True if the X axis negative stroke position sensor is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXParkOverrideActive()

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().

Returns
(boolean) True if the X axis park override is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXParkPositionPositive()

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.

Returns
(boolean) True if the X axis park position is set to positive, false if negative
Note
Documentation generated by AI on 2026-03-03

◆ IsXPositiveParkActive()

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().

Returns
(boolean) True if the X axis positive park position sensor is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXPositiveStrokeActive()

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().

Returns
(boolean) True if the X axis positive stroke position sensor is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsXStartReciprocating()

GrinderSufaceAuxModule IsXStartReciprocating ( )

Check whether the X axis reciprocating sequence is currently running.

Returns
(boolean) True if X axis reciprocating sequence (sequence 1) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZAxisHydraulic()

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.

Returns
(boolean) True if the Z axis is hydraulic, false if servo-controlled
Note
Documentation generated by AI on 2026-03-03

◆ IsZDefaultDirectionPositive()

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.

Returns
(boolean) True if the Z axis default direction is positive, false if negative
Note
Documentation generated by AI on 2026-03-03

◆ IsZGoToNegativePark()

GrinderSufaceAuxModule IsZGoToNegativePark ( )

Check whether the Z axis move-to-negative-park sequence is currently running.

Returns
(boolean) True if Z negative park sequence (sequence 15) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZGoToNegativeStroke()

GrinderSufaceAuxModule IsZGoToNegativeStroke ( )

Check whether the Z axis move-to-negative-stroke sequence is currently running.

Returns
(boolean) True if Z negative stroke sequence (sequence 13) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZGoToPositivePark()

GrinderSufaceAuxModule IsZGoToPositivePark ( )

Check whether the Z axis move-to-positive-park sequence is currently running.

Returns
(boolean) True if Z positive park sequence (sequence 14) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZGoToPositiveStroke()

GrinderSufaceAuxModule IsZGoToPositiveStroke ( )

Check whether the Z axis move-to-positive-stroke sequence is currently running.

Returns
(boolean) True if Z positive stroke sequence (sequence 12) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZHoming()

GrinderSufaceAuxModule IsZHoming ( )

Check whether the Z axis homing sequence is currently running.

Parameters
inst(number) The Mach4 instance handle. If not provided, uses current instance
Returns
(boolean) True if Z axis homing sequence (sequence 18) is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZNegativeParkActive()

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().

Returns
(boolean) True if the Z axis negative park position sensor is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZNegativeStrokeActive()

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().

Returns
(boolean) True if the Z axis negative stroke position sensor is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZParkOverrideActive()

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().

Returns
(boolean) True if the Z axis park override is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZParkPositionPositive()

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.

Returns
(boolean) True if the Z axis park position is set to positive, false if negative
Note
Documentation generated by AI on 2026-03-03

◆ IsZPositiveParkActive()

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().

Returns
(boolean) True if the Z axis positive park position sensor is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsZPositiveStrokeActive()

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().

Returns
(boolean) True if the Z axis positive stroke position sensor is active, false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ RunSequence()

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.

Parameters
sequence(number|table) The PLC sequence number or array of sequence numbers to run
Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if the sequence was started successfully, false on error
(string) Status message or error description
Note
Documentation generated by AI on 2026-03-03

◆ RunSequenceWait()

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.

Parameters
sequence(number|table) The PLC sequence number or array of sequence numbers to run
Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if the sequence completed successfully, false on error
(string) Status message or error description
Warning
This function blocks execution until the sequence completes or an error occurs. In screen chunk contexts it displays a PleaseWaitDialog to prevent UI freezing.
Note
Documentation generated by AI on 2026-03-03

◆ SetTableSpeed()

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.

Parameters
feedrate(number) The table speed feedrate value in machine units per minute
Note
Documentation generated by AI on 2026-03-03

◆ SetXDefaultDirectionNegative()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetXDefaultDirectionPositive()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetXDefaultDirectionToggle()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetXNegativeStrokePause()

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.

Parameters
pause(number) The X negative stroke pause duration in milliseconds
Returns
(nil) No value returned on error path
(boolean) False if the OEM parameter write failed
(string) Error message from w.FunctionError() if the write failed
Note
Documentation generated by AI on 2026-03-03

References pause().

◆ SetXNegativeStrokePosition()

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'.

Parameters
position(number) The negative stroke position value in machine units
Note
Documentation generated by AI on 2026-03-03

◆ SetXParkOverrideOff()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetXParkOverrideOn()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetXParkPositionNegative()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if parameter was set successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ SetXParkPositionPositive()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if parameter was set successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ SetXPositiveStrokePause()

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.

Parameters
pause(number) The X positive stroke pause duration in milliseconds
Returns
(nil) No value returned on error path
(boolean) False if the OEM parameter write failed
(string) Error message from w.FunctionError() if the write failed
Note
Documentation generated by AI on 2026-03-03

References pause().

◆ SetXPositiveStrokePosition()

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'.

Parameters
position(number) The positive stroke position value in machine units
Note
Documentation generated by AI on 2026-03-03

◆ SetZDefaultDirectionNegative()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetZDefaultDirectionPositive()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetZDefaultDirectionToggle()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetZNegativeStrokePause()

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.

Parameters
pause(number) The Z negative stroke pause duration in milliseconds
Returns
(nil) No value returned on error path
(boolean) False if the OEM parameter write failed
(string) Error message from w.FunctionError() if the write failed
Note
Documentation generated by AI on 2026-03-03

References pause().

◆ SetZNegativeStrokePick()

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.

Parameters
pick(number) The Z negative stroke pick increment value in machine units
Returns
(nil) No value returned on error path
(boolean) False if the OEM parameter write failed
(string) Error message from w.FunctionError() if the write failed
Note
Documentation generated by AI on 2026-03-03

◆ SetZParkOverrideOff()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetZParkOverrideOn()

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.

Note
Documentation generated by AI on 2026-03-03

◆ SetZParkPositionNegative()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if parameter was set successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ SetZParkPositionPositive()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if parameter was set successfully
(string) Status message from w.FunctionCompleted()
Note
Documentation generated by AI on 2026-03-03

◆ SetZPositiveStrokePause()

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.

Parameters
pause(number) The Z positive stroke pause duration in milliseconds
Returns
(nil) No value returned on error path
(boolean) False if the OEM parameter write failed
(string) Error message from w.FunctionError() if the write failed
Note
Documentation generated by AI on 2026-03-03

References pause().

◆ SetZPositiveStrokePick()

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.

Parameters
pick(number) The Z positive stroke pick increment value in machine units
Returns
(nil) No value returned on error path
(boolean) False if the OEM parameter write failed
(string) Error message from w.FunctionError() if the write failed
Note
Documentation generated by AI on 2026-03-03

◆ StartCrossover()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if crossover completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ TeachXNegativeTableParkPosition()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if the sequence completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ TeachXNegativeTableStrokePosition()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if the sequence completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ TeachXPositiveTableParkPosition()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if the sequence completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ TeachXPositiveTableStrokePosition()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if the sequence completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XAndZReset()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if both axes reset successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XGoToDressPosition()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XGoToNegativePark()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XGoToNegativeStroke()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XGoToPositivePark()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XGoToPositiveStroke()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XHome()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if homing completed or was skipped, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XParkOverrideToggle()

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.

Note
Documentation generated by AI on 2026-03-03

◆ XReciprocatingToggle()

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.

Note
Documentation generated by AI on 2026-03-03

◆ XReset()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if reset completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ XStartReciprocating()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if reciprocating is active or started successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ ZGoToNegativePark()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ ZGoToNegativeStroke()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ ZGoToPositivePark()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ ZGoToPositiveStroke()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if move completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ ZHome()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if homing completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03

◆ ZParkOverrideToggle()

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.

Note
Documentation generated by AI on 2026-03-03

◆ ZReset()

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.

Returns
(nil) Primary return value is always nil
(boolean) Success flag - true if reset completed successfully, false on error
(string) Status message from w.FunctionCompleted() or error description
Note
Documentation generated by AI on 2026-03-03