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

Go to the source code of this file.

Functions

GrinderODIDAuxModule InitializeGapOutputs ()
 Initialize gap control output signals and add them to the output ignore lists.
GrinderODIDAuxModule IsGapControlEnabled ()
 Check whether the gap control feature is enabled.
GrinderODIDAuxModule SetGapControlModeGrind (skip_wait)
 Switch the gap control system to grind mode.
GrinderODIDAuxModule IsGapControlModeGrind ()
 Check whether the gap control system is currently in grind mode.
GrinderODIDAuxModule SetGapControlModeDress ()
 Switch the gap control system to dress mode.
GrinderODIDAuxModule IsGapControlModeDress ()
 Check whether the gap control system is currently in dress mode.
GrinderODIDAuxModule IsActiveFlagEnabled (flagidx)
 Check whether the active flag feature is enabled for the specified flag index.
GrinderODIDAuxModule FlagInitialize ()
 Initialize active flag slides by restoring their extend outputs to match current state.

Function Documentation

◆ FlagInitialize()

GrinderODIDAuxModule FlagInitialize ( )

Initialize active flag slides by restoring their extend outputs to match current state.

Iterates over flag indices 0 through 3. For each enabled flag (per IsActiveFlagEnabled()), if the slide is currently extended (per IsActiveFlagSlideExtended()), the corresponding "ActiveFlagSlideExtendOutput_{i}" signal is set to true to restore the output state. This ensures that output signals are consistent with the physical slide positions after a restart or re-initialization.

Note
Documentation generated by AI on 2026-03-03

◆ InitializeGapOutputs()

GrinderODIDAuxModule InitializeGapOutputs ( )

Initialize gap control output signals and add them to the output ignore lists.

Registers the "GapControlM1Output" and "GapControlM2Output" OEM parameter signals to be ignored during disable, stop, and emergency stop events by adding them to the IgnoreOutputsOnDisable, IgnoreOutputsOnStop, and IgnoreOutputsOnEmergencyStop ignore lists. This prevents the gap control outputs from being cleared when the machine stops or is disabled.

Note
Documentation generated by AI on 2026-03-03

◆ IsActiveFlagEnabled()

GrinderODIDAuxModule IsActiveFlagEnabled ( flagidx )

Check whether the active flag feature is enabled for the specified flag index.

Parameters
flagidx(number|nil) The index of the active flag to check (0-3). Defaults to 0 if nil
Returns
(boolean) True if OEM parameter "ActiveFlagEnabled_{flagidx}" equals "Yes", false otherwise
Note
Returns false (rather than raising an error) if the OEM parameter read fails
Documentation generated by AI on 2026-03-03

◆ IsGapControlEnabled()

GrinderODIDAuxModule IsGapControlEnabled ( )

Check whether the gap control feature is enabled.

Reads the OEM parameter "GapControlEnabled" and returns true if its value is "Yes". Raises an error via w.Error() if the parameter cannot be read.

Returns
(boolean) True if GapControlEnabled OEM parameter equals "Yes", false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsGapControlModeDress()

GrinderODIDAuxModule IsGapControlModeDress ( )

Check whether the gap control system is currently in dress mode.

Reads the "GapControlM2Input" OEM parameter signal to determine if the gap controller has confirmed dress mode. If gap control is not enabled, returns false immediately. If the signal is not mapped, returns false.

Returns
(boolean) True if gap control is enabled and the M2 input signal is active (dress mode confirmed), false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ IsGapControlModeGrind()

GrinderODIDAuxModule IsGapControlModeGrind ( )

Check whether the gap control system is currently in grind mode.

Reads the "GapControlM1Input" OEM parameter signal to determine if the gap controller has confirmed grind mode. If gap control is not enabled, returns false immediately. If the signal is not mapped, returns false.

Returns
(boolean) True if gap control is enabled and the M1 input signal is active (grind mode confirmed), false otherwise
Note
Documentation generated by AI on 2026-03-03

◆ SetGapControlModeDress()

GrinderODIDAuxModule SetGapControlModeDress ( )

Switch the gap control system to dress mode.

If gap control is not enabled or the system is already in dress mode, the function returns immediately. Otherwise, it drives the mode change by:

  1. Setting GapControlM1Output to false
  2. Setting GapControlM2Output to true
  3. Waiting up to 30 seconds for GapControlM2Input to confirm dress mode
  4. Setting GapControlM2Output back to false
    Warning
    This function blocks execution for up to 30 seconds waiting for the GapControlM2Input signal.
    Note
    Documentation generated by AI on 2026-03-03

◆ SetGapControlModeGrind()

GrinderODIDAuxModule SetGapControlModeGrind ( skip_wait )

Switch the gap control system to grind mode.

If gap control is not enabled or the system is already in grind mode, the function returns immediately. Otherwise, it drives the mode change by:

  1. Setting GapControlM2Output to false
  2. Setting GapControlM1Output to true
  3. If skip_wait is false, waits 100ms for the output to activate (w.Sleep)
  4. If skip_wait is true, waits up to 30 seconds for GapControlM1Input to confirm grind mode
  5. Setting GapControlM1Output back to false
    Parameters
    skip_wait(boolean|nil) If true, waits for the M1 input confirmation signal instead of a fixed delay. Defaults to false
    Warning
    When skip_wait is true, this function blocks execution for up to 30 seconds waiting for the GapControlM1Input signal.
    Note
    Documentation generated by AI on 2026-03-03