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

Go to the source code of this file.

Functions

Sim Create (context)
 Create a Sim motion controller object for the given Mach4 instance.
Sim OpenConfiguration ()
 Open the Sim motion controller configuration window.
Sim Initialization ()
 Perform Sim motion controller initialization at Mach4 startup.
Sim IsAxisMotorAbsoluteEncoder ()
 Check whether any motor on the specified axis uses an absolute encoder (Sim).
HiCON IsInitialized ()
 Check whether the HiCON motion controller has completed initialization.
HiCON ReadAbsoluteEncoderPositions ()
 Read absolute encoder positions for all configured motors on the HiCON controller.
HiCON IsMotorAbsoluteEncoder ()
 Check whether the specified motor uses an absolute encoder on the HiCON controller.
HiCON PLCScript ()
 PLC script callback for HiCON motion controller periodic housekeeping.
HiCON PreEnableReset ()
 Re-read absolute encoder positions before a machine enable reset on the HiCON controller.
HiCON MotionSync ()
 Synchronize the HiCON motion controller's internal position to the encoder positions.
HiCON UpdateMotorMapping ()
 Send the UPDATE_SOURCE_SETTINGS command to the HiCON motion controller.
HiCON SupportsManualModeFeature ()
 Report whether the HiCON motion controller supports the manual mode feature.
HiCON SetAxisMotorsManualModeOn ()
 Enable manual mode for a specific axis's motors on the HiCON controller.
HiCON SetAxisMotorsManualModeOff ()
 Disable manual mode for a specific axis's motors on the HiCON controller.
HiCON PreHoming ()
 Perform pre-homing signal setup for the HiCON motion controller.
HiCON WaitForHomingToComplete ()
 Wait for HiCON homing motion to complete using a timed please-wait dialog.
HiCON PostHoming ()
 Perform post-homing signal cleanup for the HiCON motion controller.
M31 SetManualModeOn ()
 No-op implementation of manual mode on for the M31 motion controller.
M31 SetManualModeOff ()
 No-op implementation of manual mode off for the M31 motion controller.
RapidPath OpCmdReg ()
 Get or resolve and cache the operational command register handle for a RapidPath instance.
RapidPath LogF (...)
 Write a formatted log message to the Mach4 diagnostic log for this RapidPath instance.
RapidPath ResolveRPRegister (inst)
 Resolve a named RapidPath register to its Mach4 handle.
RapidPath ResolveRPIO (inst)
 Resolve a named RapidPath I/O point to its Mach4 handle.
RapidPath MarkSingleMotorConnection (discon)
 Stage a single motor connection or disconnection change without committing it.
RapidPath CommitMotorConnections ()
 Commit all staged (queued) motor connection changes to the RapidPath plugin.
RapidPath RollbackMotorConnections ()
 Discard all staged (queued) motor connection changes without applying them.
RapidPath ConnectAllMotors ()
 Reconnect all motors to active servo control in the RapidPath plugin.
RapidPath DisconnectAllMotors ()
 Disconnect all motors from active servo control in the RapidPath plugin.
RapidPath MarkCommitSingleMotorConnection (discon)
 Mark and immediately commit a single motor connection or disconnection change.
RapidPath MarkCommitMultipleMotorConnections (discon_flgs)
 Mark and immediately commit connection changes for multiple motors (untested).
RapidPath IsDisconnectedMotor ()
 Check whether a motor is currently disconnected in the RapidPath plugin.
RapidPath IsDisconnectedMotor_Que ()
 Check whether a motor is queued for disconnection in the RapidPath plugin.
RapidPath GetMotorCount ()
 Get the total number of motor devices controlled by the RapidPath plugin.
RapidPath CreatePreCannedCommands ()
 Create all pre-canned user commands for the RapidPath motion controller.
RapidPath FDC_IsCapturing ()
 Check whether an FDC capture or export session is currently active.
RapidPath FDC_ClearTraces ()
 Clear all configured FDC traces and discard any accumulated header data.
RapidPath FDC_ShowTraces ()
 Display information about currently configured FDC traces in a message box.
RapidPath FDC_StopCapture ()
 Stop an active FDC data capture session.
RapidPath FDC_StartCapture ()
 Start an FDC data capture session, optionally writing to a specified file.
RapidPath FDC_Add_MotorCommands ()
 Add FDC traces for commanded (reference) motor position, velocity, and acceleration.
RapidPath FDC_Add_MotorFeedback ()
 Add FDC traces for actual (feedback) motor position and velocity.
RapidPath FDC_Add_MotorFWStatus ()
 Add FDC traces for per-motor firmware status words.
RapidPath FDC_Add_MultiAxisFWStatus ()
 Add FDC traces for the multi-axis firmware motion status word.
RapidPath FDC_Add_MotorBacklash ()
 Add FDC traces for motor backlash compensation values.
RapidPath FDC_Add_MotorControlStatusWords ()
 Add FDC traces for CANopen control word and status word for each motor.
RapidPath FDC_Add_PluginData ()
 Add FDC traces for RapidPath plugin and cycle planner status buffers.
RapidPath FDC_Add_ProbingData ()
 Add FDC traces for probing status and probe input signals.
RapidPath FDC_Add_HomingData ()
 Add FDC traces for homing-related signals, user limits, user buffers, and encoder values.
RapidPath FDC_Add_LaserData ()
 Add FDC traces for laser power, shutter, motion ID, and position error.
RapidPath FDC_AddHeader_MotorData ()
 Add motor metadata header entries to the FDC export file for all controlled motors.
RapidPath FDC_AddHeader (value)
 Add a key-value metadata header entry to the FDC export file.
RapidPath ReadSDO (subindex, device_spec, byte_count)
RapidPath WriteSDO (index, subindex, device_spec, byte_count)
RapidPath SyncAxisMotorPositions ()
 Synchronize the motor positions for all motors on the specified axis.
RapidPath GetMotorDisplayName ()
 Get the display name of the device associated with a RapidPath motor.
RapidPath GetLoadRegister ()
 Get the Mach4 register path for the load (torque percentage) of the given axis.
RapidPath IsVirtualMotor ()
 Check whether the specified motor is a virtual (non-physical) motor in RapidPath.
RapidPath GetLoadPercent ()
 Get the load percentage for the specified axis from the RapidPath plugin.
RapidPath Reconfig ()
 Invalidate cached data after a Mach4 or motion controller reconfiguration.
RapidPath OperationCommand (target_instance)
 Send an operation command to the RapidPath plugin and return the result.
RapidPath ResetAlarms ()
 Wait for RapidPath drives to become operable and clear any active drive alarms.
RapidPath ResetSafetyRelay ()
 Send a reset command to the RapidPath safety relay watchdog.
RapidPath IsEnableSequenceFinished ()
 Check whether the machine enable sequence has finished for RapidPath.
RapidPath IsOperational ()
 Check whether the RapidPath plugin is in a good operational state.
RapidPath Destroy ()
 Clean up the RapidPath motion controller object before it is released.
RapidPath OneTimeInitialization ()
 Perform one-time startup initialization for the RapidPath motion controller.
RapidPath OneTimeOperationalInitialization ()
 Perform one-time initialization that requires RapidPath to be operational.
 generator_feedback (hIo)
 Return a closure that reads the current state of a generic soft input I/O point.
 generator_toggle (hIo, io_path)
 Return a closure that toggles the specified generic soft input I/O point.
RapidPath IsLeader ()
 Determine whether this RapidPath plugin instance is the leader instance.
RapidPath HandleOperationStatus ()
 Monitor RapidPath plugin operational state and manage the operational status dialog.
fn_table is_operable (obj, mc_obj)
 Check whether the RapidPath motion controller is currently operational.
fn_table summary (obj, mc_obj)
 Provide the executive summary status string for the OpStatus dialog.
fn_table level1 (obj, mc_obj)
 Provide the plugin action status string for the OpStatus dialog.
fn_table level2 (obj, mc_obj)
 Provide the controller action status string for the OpStatus dialog.
fn_table level3 (obj, mc_obj)
 Provide the detail-level 3 status string for the OpStatus dialog.
fn_table progress (obj, mc_obj)
 Provide progress pulse information for the OpStatus dialog.
fn_table button_label (obj, mc_obj)
 Provide the label for the optional action button in the OpStatus dialog.
fn_table button_click (obj, mc_obj)
 Handle the user clicking the override button in the OpStatus dialog.
fn_table log (obj_args, fmt,...)
 Log function for the OpStatus dialog, routing messages to the Mach diagnostic log.
fn_table wxdialog_ctor (...)
 Placeholder for optional wxDialog constructor override in the OpStatus function table.
RapidPath ParseMCodeCategory_RP ()
 Convert from the numeric value for category (used in the M codes) to the corresponding string name.
RapidPath Profiling_PopulateCategoryInfo ()
RapidPath ControlProfilingEx (_category, new_state, alt_cmd, file_path, wait_value)
RapidPath ControlProfilingEx_OpCmd (base_op_cmd, new_state, alt_cmd, file_path, wait_value, feedback)
RapidPath ControlProfilingEx_FDC (preset_name, new_state, alt_cmd, file_path, wait_value)
RapidPath ControlProfilingEx_ParseNewState_VB ()
 Parse a verbose log new_state value into a string action command.
RapidPath ControlProfilingEx_VerboseLog (preset_name, new_state, alt_cmd, file_path, wait_value)
MotionController Create (Context, DeviceName)
 Create a motion controller object for the specified Mach4 instance.
MotionController InitializeGeneric ()
 Initialize generic motion controller profiling resources on first call.
MotionController InvokeDataViz ()
 Launch the MachMotion Data Visualization tool as an external process.
MotionController InvokeDataVizAsync ()
 Launch the Data Visualizer asynchronously using a short-delay wxTimer.
MotionController CreateGenericCommands ()
 Create user commands applicable to all motion controllers.
MotionController GetName ()
 Return the display name of this motion controller instance.
MotionController GetMotionDeviceName ()
 Retrieve the name of the motion device configured for the given Mach4 instance.
MotionController SetDefunct ()
 Mark this motion controller object as defunct or restore it to normal operation.
MotionController IsDefunct ()
 Check whether this motion controller object has been marked as defunct.
MotionController GetMasterMotor ()
 Get the master (first) motor ID for the given axis.
MotionController PreDriveEnable ()
 Base implementation of pre-drive-enable actions for the motion controller.
MotionController SetAxisMotorsPosition (position)
 Set the position of an axis's motors by sending a zero-reference message to the plugin.
MotionController ControlProfilingEx (category, new_state, file_path, wait_value)
MotionController ControlProfiling ()
 Invokes ControlProfilingEx(...) but includes an empty set of options.
MotionController ProfilingLib ParseNewState (new_state, feedback)
MotionController ProfilingLib IOStateChecker (inst, device_name, io_name)
obj check (self)
 Check the current state of the I/O point associated with this checker object.
MotionController ProfilingLib WaitForEffective (desired_state, feedback)
 Wait for a profiling feedback state to reach a desired value with a 10-second timeout.
MotionController ParseMCodeCategory_G ()
 Parse an M-code numeric category value into its corresponding string name.
MotionController ControlProfilingEx_Generic (_category,...)
MotionController ControlProfilingEx_MotionDataProfiler (category, _new_state, alt_cmd, file_path, wait_value)

Function Documentation

◆ button_click()

fn_table button_click ( obj ,
mc_obj  )

Handle the user clicking the override button in the OpStatus dialog.

Logs a message indicating the user has confirmed RapidPath ENI regeneration, then sends a 'ConfirmENIRegeneration' command to the RapidPath plugin via w.RegSendCommand(). This is called when the operator clicks the action button shown in the operational status dialog while the OpStat_NeedConfirmation_ENIRegen I/O is active.

Note
Documentation generated by AI on 2026-03-04

◆ button_label()

fn_table button_label ( obj ,
mc_obj  )

Provide the label for the optional action button in the OpStatus dialog.

Queries the 'OpStat_NeedConfirmation_ENIRegen' I/O state via the cached handle in mc_obj.op_status.button_label. Returns 'Override ENI File' when the I/O is active (state==1), or nil when the button should not be shown.

Parameters
obj(table) The OpStatus object (first element of the ARGS table)
mc_obj(table) The RapidPath motion controller object
Returns
(string|nil) The button label string, or nil if the button should be hidden
Note
Documentation generated by AI on 2026-03-04

◆ check()

obj check ( self )

Check the current state of the I/O point associated with this checker object.

Resolves the I/O handle on first call and caches it for subsequent calls. Queries the Mach4 API for the current I/O state and returns true if the state is non-zero (active). Raises an error if the I/O handle cannot be resolved.

Parameters
self(table) The IOStateChecker object containing inst, dev, io, and hIo fields
Returns
(boolean) True if the I/O is active (non-zero state), false otherwise
Warning
Raises an error via w.Error() if the I/O path cannot be resolved
Note
Documentation generated by AI on 2026-03-04

◆ CommitMotorConnections()

RapidPath CommitMotorConnections ( )

Commit all staged (queued) motor connection changes to the RapidPath plugin.

Validates that the machine is disabled and that no configuration operation is currently in progress via the 'ConfigRequestCount' register. Sends a 'CommitMotorConnections' operation command to the RapidPath plugin via OpCmdReg() to apply all pending changes staged by one or more MarkSingleMotorConnection() calls. If the machine is enabled, displays a message box and raises an error. If the API call fails, logs a message and returns 'API ERROR'.

Returns
(string) Plugin response: 'OK', 'NO_CHANGE', 'REG_ERROR', or 'API ERROR'
Warning
Machine must be disabled before calling; raises an error and displays a message box if enabled
See also
RapidPath:MarkSingleMotorConnection() to stage individual motor changes before committing
RapidPath:RollbackMotorConnections() to discard staged changes instead of committing
Note
Documentation generated by AI on 2026-03-04

◆ ConnectAllMotors()

RapidPath ConnectAllMotors ( )

Reconnect all motors to active servo control in the RapidPath plugin.

Validates that the machine is disabled and that no configuration operation is currently in progress via the 'ConfigRequestCount' register. Sends a 'ConnectAllMotors' operation command to the RapidPath plugin via OpCmdReg(). If the machine is enabled, displays a message box and raises an error. If the API call fails, logs a message and returns 'API ERROR'.

Returns
(string) Plugin response: 'OK', 'NO_CHANGE', 'REG_ERROR', or 'API ERROR'
Warning
Machine must be disabled before calling; raises an error and displays a message box if enabled
See also
RapidPath:DisconnectAllMotors() to disconnect all motors
RapidPath:CommitMotorConnections() for committing staged changes
Note
Documentation generated by AI on 2026-03-04

◆ ControlProfiling()

MotionController ControlProfiling ( )

Invokes ControlProfilingEx(...) but includes an empty set of options.

Invoke ControlProfilingEx with an empty options table

Convenience wrapper that calls ControlProfilingEx() with an empty options table as the first argument, forwarding all other arguments unchanged. Use this when no special options are required for the profiling operation.

Parameters
...(any) Arguments forwarded to ControlProfilingEx(): category, new_state, file_path, wait_value
Returns
(boolean) True if the profiling operation was handled successfully, false otherwise
See also
MotionController:ControlProfilingEx() for full parameter documentation
Note
Documentation generated by AI on 2026-03-04

◆ ControlProfilingEx() [1/2]

RapidPath ControlProfilingEx ( _category ,
new_state ,
alt_cmd ,
file_path ,
wait_value  )

◆ ControlProfilingEx() [2/2]

MotionController ControlProfilingEx ( category ,
new_state ,
file_path ,
wait_value  )

◆ ControlProfilingEx_FDC()

RapidPath ControlProfilingEx_FDC ( preset_name ,
new_state ,
alt_cmd ,
file_path ,
wait_value  )

◆ ControlProfilingEx_Generic()

MotionController ControlProfilingEx_Generic ( _category ,
... )

◆ ControlProfilingEx_MotionDataProfiler()

MotionController ControlProfilingEx_MotionDataProfiler ( category ,
_new_state ,
alt_cmd ,
file_path ,
wait_value  )

◆ ControlProfilingEx_OpCmd()

RapidPath ControlProfilingEx_OpCmd ( base_op_cmd ,
new_state ,
alt_cmd ,
file_path ,
wait_value ,
feedback  )

◆ ControlProfilingEx_ParseNewState_VB()

RapidPath ControlProfilingEx_ParseNewState_VB ( )

Parse a verbose log new_state value into a string action command.

Converts the new_state parameter for the VerboseLog profiling category into a string action name ('Clear' or 'Archive'). Accepts boolean, string, or integer input. Boolean true maps to 'Archive', false to 'Clear'. Integer 0 maps to 'Clear', 1 to 'Archive'. String values are returned as-is. Raises an error if the integer value is not 0 or 1, or if the value cannot be parsed as an integer.

Parameters
new_state_value(boolean|string|number) The new state value to parse
Returns
(string) The string action: 'Clear' or 'Archive'
Warning
Raises an error via w.Error() if new_state_value is an unrecognized integer or cannot be parsed
Note
Documentation generated by AI on 2026-03-04

◆ ControlProfilingEx_VerboseLog()

RapidPath ControlProfilingEx_VerboseLog ( preset_name ,
new_state ,
alt_cmd ,
file_path ,
wait_value  )

◆ Create() [1/2]

Sim Create ( context )

Create a Sim motion controller object for the given Mach4 instance.

Create a Generic motion controller object for the given Mach4 instance.

Create a RapidPath motion controller object for the given Mach4 instance.

Create a TrioMotion motion controller object for the given Mach4 instance.

Create a DSPMC motion controller object for the given Mach4 instance.

Create an M31 motion controller object for the given Mach4 instance.

Create a HiCON motion controller object for the given Mach4 instance.

Instantiates a new Sim motion controller using setmetatable. Sets the defunct flag to false, assigns the instance handle, sets the name to 'Sim0', and sets the register device name to 'Sim0'. Used when the configured motion device is 'Sim0' or 'SimDev0'.

Parameters
instance(number) The Mach4 instance handle for this controller object
context(string) The execution context string (e.g., 'SCREEN' or 'MCODE')
Returns
(table) A new Sim motion controller object
See also
HiCON:Create() for the equivalent HiCON implementation
MotionController:Create() for the factory method that calls this
Note
Documentation generated by AI on 2026-03-04

Instantiates a new HiCON motion controller using setmetatable. Sets the defunct flag to false, assigns the instance handle, sets the name to 'HiCON', and sets the register device name to 'HiCON'.

Parameters
instance(number) The Mach4 instance handle for this controller object
context(string) The execution context string (e.g., 'SCREEN' or 'MCODE')
Returns
(table) A new HiCON motion controller object
See also
M31:Create() for the equivalent M31 implementation
MotionController:Create() for the factory method that calls this
Note
Documentation generated by AI on 2026-03-04

Instantiates a new M31 motion controller using setmetatable. Sets the defunct flag to false, assigns the instance handle, sets the name to 'M31', and sets the register device name to 'M31'.

Parameters
instance(number) The Mach4 instance handle for this controller object
context(string) The execution context string (e.g., 'SCREEN' or 'MCODE')
Returns
(table) A new M31 motion controller object
See also
HiCON:Create() for the equivalent HiCON implementation
Note
Documentation generated by AI on 2026-03-04

Instantiates a new DSPMC motion controller using setmetatable. Sets the defunct flag to false, assigns the instance handle, sets the name to 'DSPMC', and sets the register device name to 'DSPMC'.

Parameters
instance(number) The Mach4 instance handle for this controller object
context(string) The execution context string (e.g., 'SCREEN' or 'MCODE')
Returns
(table) A new DSPMC motion controller object
Note
Documentation generated by AI on 2026-03-04

Instantiates a new TrioMotion motion controller using setmetatable. Sets the defunct flag to false, assigns the instance handle, sets the name to 'TrioMotion', and sets the register device name to 'TrioMotion'.

Parameters
instance(number) The Mach4 instance handle for this controller object
context(string) The execution context string (e.g., 'SCREEN' or 'MCODE')
Returns
(table) A new TrioMotion motion controller object
Note
Documentation generated by AI on 2026-03-04

Instantiates a new RapidPath motion controller using setmetatable. Sets the defunct flag to false and assigns the instance handle and device name. When the context is 'SCREEN', resolves and caches register handles for the plugin FSM state, RMP FSM state, and all operational status dialog registers and I/O. Initializes the event handler, calls Profiling_PopulateCategoryInfo() to build profiling metadata, and initializes the load register cache.

Parameters
instance(number) The Mach4 instance handle for this controller object
context(string) The execution context string (e.g., 'SCREEN' or 'MCODE')
Returns
(table) A new RapidPath motion controller object
Note
In SCREEN context, additional FSM and OpStatus registers are resolved during creation
See also
RapidPath:Profiling_PopulateCategoryInfo() for profiling metadata initialization
Note
Documentation generated by AI on 2026-03-04

Instantiates a new Generic motion controller using setmetatable. Sets the defunct flag to false and assigns the instance handle. The name field is set to a string combining 'GenericMotionController:' with the motion device name returned by GetMotionDeviceName(). Used as a fallback when no recognized device name is found during MotionController:Create().

Parameters
instance(number) The Mach4 instance handle for this controller object
context(string) The execution context string (e.g., 'SCREEN' or 'MCODE')
Returns
(table) A new Generic motion controller object
Note
Documentation generated by AI on 2026-03-04

◆ Create() [2/2]

MotionController Create ( Context ,
DeviceName  )

Create a motion controller object for the specified Mach4 instance.

Factory method that determines the appropriate motion controller subclass to instantiate based on the configured motion device name. If DeviceName is not provided, the device name is queried from the Mach4 machine profile via GetMotionDeviceName(). Supported device names are: 'HiCON', 'M31', 'DSPMC', 'RapidPath', 'Sim0', 'SimDev0'. Any unrecognized device name falls back to the Generic subclass with a log message.

Parameters
instance(number) The Mach4 instance handle for the new controller object
Context(string) The execution context string (e.g., 'SCREEN' or 'MCODE')
DeviceName(string|nil) The motion device name to instantiate. If nil, queries the machine profile
Returns
(table) A motion controller object of the appropriate subclass
Note
Documentation generated by AI on 2026-03-04

◆ CreateGenericCommands()

MotionController CreateGenericCommands ( )

Create user commands applicable to all motion controllers.

Initializes generic motion controller resources via InitializeGeneric(), then registers user commands common to all controller types. If the MotionDataProfiler plugin is available (detected via the command register handle), creates a toggle command for MDP motion capture that automatically opens the Data Visualizer after capture stops. Also creates an 'Open Data Visualizer' command that launches the visualizer asynchronously. This method should be called explicitly from all subclass CreatePreCannedCommands() implementations.

Note
Documentation generated by AI on 2026-03-04

◆ CreatePreCannedCommands()

RapidPath CreatePreCannedCommands ( )

Create all pre-canned user commands for the RapidPath motion controller.

Create pre-canned user commands for the motion controller.

Calls CreateGenericCommands() to register commands common to all controllers, then registers RapidPath-specific commands. For each motor (0 through GetMotorCount()-1), creates 'Disconnect Motor N' (immediate commit) and 'Que Disconnect Motor N' (staged) commands with corresponding feedback. Creates 'Commit Motor Connections', 'Rollback Motor Connections', and 'Connect All Motors' commands. For axes with more than one motor, creates 'Sync Slave Positions' commands. Also creates the full suite of FDC data capture commands (toggle capture, add traces, show/clear traces, options), a Data Visualizer command, and a 'Clear RapidPath Verbose Log' command. FDC capture option flags are managed via the fdc_capture_options table.

Note
This function should be called once during screen initialization
See also
MotionController:CreateGenericCommands() for generic commands created as part of this call
Note
Documentation generated by AI on 2026-03-04

Base implementation that creates the generic commands applicable to all motion controllers by calling CreateGenericCommands(). Subclasses such as RapidPath override this to register additional controller-specific commands (motor disconnect, FDC capture, slave sync, etc.) while also calling this base method via self:CreateGenericCommands().

Returns
(boolean) False in the base implementation
See also
MotionController:CreateGenericCommands() for the generic commands created here
RapidPath:CreatePreCannedCommands() for the RapidPath-specific extension
Note
Documentation generated by AI on 2026-03-04

◆ Destroy()

RapidPath Destroy ( )

Clean up the RapidPath motion controller object before it is released.

Base implementation to destroy and clean up the motion controller object.

Checks whether an operational status dialog (op_status.notice) is currently open. If a notice exists and was shown, calls EndModal() on it to close the dialog and unblock any modal loop before the object is destroyed. This prevents orphaned dialogs when the motion controller is torn down during Mach4 shutdown or reconfiguration.

See also
RapidPath:HandleOperationStatus() which creates and manages the op_status.notice dialog
Note
Documentation generated by AI on 2026-03-04

Logs a message indicating no destruction method is implemented for the current motion controller type. Subclasses (RapidPath) override this to perform cleanup such as closing open operational status dialogs before the object is released.

Note
Documentation generated by AI on 2026-03-04

◆ DisconnectAllMotors()

RapidPath DisconnectAllMotors ( )

Disconnect all motors from active servo control in the RapidPath plugin.

Validates that the machine is disabled and that no configuration operation is currently in progress. Sends a 'DisconnectAllMotors' operation command to the RapidPath plugin via OpCmdReg(). If the machine is enabled, displays a message box and raises an error. If the API call fails, logs a message and returns 'API ERROR'.

Returns
(string) Plugin response: 'OK', 'NO_CHANGE', 'REG_ERROR', or 'API ERROR'
Warning
Machine must be disabled before calling; raises an error and displays a message box if enabled
See also
RapidPath:ConnectAllMotors() to reconnect all motors
RapidPath:CommitMotorConnections() for committing staged changes
Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_HomingData()

RapidPath FDC_Add_HomingData ( )

Add FDC traces for homing-related signals, user limits, user buffers, and encoder values.

Wraps _FDC_Add_HomingData() with pcall error handling. For each Mach4 instance and controlled motor, adds: the home switch signal trace (if mapped), two generic user limit status traces, user buffer traces for homing state, motor status, and home generic values, and an encoder value trace. Also adds a homing status bitvec trace and a plugin status trace per instance. Saves home input active-low information and motion group/multi-axis membership as header data.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_LaserData()

RapidPath FDC_Add_LaserData ( )

Add FDC traces for laser power, shutter, motion ID, and position error.

Wraps _FDC_Add_LaserData() with pcall error handling. For each Mach4 instance, adds an analog output trace for the laser power analog (PV_LASER_ANALOG_NUMBER) and a signal trace for the shutter on signal (OSIG_SHUTTER_ON), saving active low info as header data. If a motion group is found for the instance, also adds traces for MOTION_ID and MOTION_ELEMENT_ID on the first RMP axis in the group, and POSITION_ERROR for all axes in the group. Saves analog output transformation parameters and active low info to FDC headers.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_MotorBacklash()

RapidPath FDC_Add_MotorBacklash ( )

Add FDC traces for motor backlash compensation values.

Wraps _FDC_Add_MotorBacklash() with pcall error handling. For each Mach4 instance and controlled motor, resolves the RMP axis index and adds a real-time trace for the BACKLASH_VALUE firmware address, captured as a Double. Trace names follow the pattern 'Axis<N>.CurrentBacklash'. Addresses are looked up from the runtime RapidPath properties.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_MotorCommands()

RapidPath FDC_Add_MotorCommands ( )

Add FDC traces for commanded (reference) motor position, velocity, and acceleration.

Wraps _FDC_Add_MotorCommands() with pcall error handling. For each Mach4 instance and controlled motor, resolves the RMP axis index and adds real-time Double traces for COMMAND_POSITION, COMMAND_VELOCITY, and COMMAND_ACCELERATION firmware addresses. Trace names follow the pattern 'Axis<N>.CommandPosition', 'Axis<N>.CommandVelocity', and 'Axis<N>.CommandAcceleration'. Addresses are looked up from the runtime RapidPath properties.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_MotorControlStatusWords()

RapidPath FDC_Add_MotorControlStatusWords ( )

Add FDC traces for CANopen control word and status word for each motor.

Wraps _FDC_Add_MotorControlStatusWords() with pcall error handling. For each Mach4 instance and controlled motor, resolves the RMP axis index and adds two real-time traces: one for the CANopen PDO ControlWord firmware address and one for the StatusWord firmware address. Both are captured as UInt32 values. Trace names follow the pattern 'Axis<N>.ControlWord' and 'Axis<N>.StatusWord'.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_MotorFeedback()

RapidPath FDC_Add_MotorFeedback ( )

Add FDC traces for actual (feedback) motor position and velocity.

Wraps _FDC_Add_MotorFeedback() with pcall error handling. For each Mach4 instance and controlled motor, resolves the RMP axis index and adds real-time Double traces for ACTUAL_POSITION and ACTUAL_VELOCITY firmware addresses. Trace names follow the pattern 'Axis<N>.ActualPosition' and 'Axis<N>.ActualVelocity'. Addresses are looked up from the runtime RapidPath properties.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_MotorFWStatus()

RapidPath FDC_Add_MotorFWStatus ( )

Add FDC traces for per-motor firmware status words.

Wraps _FDC_Add_MotorFWStatus() with pcall error handling. For each Mach4 instance and controlled motor, resolves the RMP axis index and adds a real-time UInt32 trace for the motor STATUS firmware address. Trace names follow the pattern 'Axis<N>.FirmwareStatus'. Addresses are looked up from the runtime RapidPath properties.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_MultiAxisFWStatus()

RapidPath FDC_Add_MultiAxisFWStatus ( )

Add FDC traces for the multi-axis firmware motion status word.

Wraps _FDC_Add_MultiAxisFWStatus() with pcall error handling. For each Mach4 instance, retrieves the motion group ID and its associated MultiAxis index. Adds a real-time UInt32 trace for the MultiAxis MOTION_STATUS firmware address. Also records the RMP axis indices belonging to the motion group as a semicolon-delimited header entry under the key 'instance.<N>.motion_group.<M>.multi_axis.<K>'.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_PluginData()

RapidPath FDC_Add_PluginData ( )

Add FDC traces for RapidPath plugin and cycle planner status buffers.

Wraps _FDC_Add_PluginData() with pcall error handling. For each Mach4 instance, adds real-time user buffer traces for: plugin status, cycle planner count, MovePT failure count, MovePT counter, and GM inhibit value. Trace names include the instance number as a suffix. Addresses are looked up from the plugin user buffer firmware address table.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_Add_ProbingData()

RapidPath FDC_Add_ProbingData ( )

Add FDC traces for probing status and probe input signals.

Wraps _FDC_Add_ProbingData() with pcall error handling. For each Mach4 instance, adds a user buffer trace for the probing status bitvec. Then iterates over all probe signal IDs (ISIG_PROBE through ISIG_PROBE9); for each enabled and mapped signal, looks up the associated I/O and device info and adds an I/O trace via 'FDCAddTraceIO'. Saves the active low flag for each probe signal as a header entry.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_AddHeader()

RapidPath FDC_AddHeader ( value )

Add a key-value metadata header entry to the FDC export file.

Wraps _FDC_AddHeader() with pcall error handling. If the underlying call raises an error, displays a message box describing the failure and re-raises the error via w.Error(). On success, sends a 'FDCAddHeaderData;<path>,

' operation command to the RapidPath plugin.

Parameters
path(string) The dot-separated metadata key path (e.g., 'metadata.preset')
value(any) The value to associate with the key in the FDC export header
See also
RapidPath:FDC_AddHeader_MotorData() for adding motor-specific header entries in bulk
Note
Documentation generated by AI on 2026-03-04

◆ FDC_AddHeader_MotorData()

RapidPath FDC_AddHeader_MotorData ( )

Add motor metadata header entries to the FDC export file for all controlled motors.

Wraps _FDC_AddHeader_MotorData() with pcall error handling. Iterates over all Mach4 instances and their controlled motor IDs. For each motor, retrieves the motor info struct and writes CountsPerUnit, MaxVelocity, and MaxAcceleration header entries. Also writes the motor's Mach axis ID and RMP axis index as header entries. Header key paths follow the format 'instance.<N>.motors.<M>.<Key>'.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_ClearTraces()

RapidPath FDC_ClearTraces ( )

Clear all configured FDC traces and discard any accumulated header data.

Calls _FDC_ClearHeaderData() to remove any pending FDC header entries, then sends the 'FDCClearTraces' operation command to the RapidPath plugin to remove all configured data traces. Returns true if the plugin responds with 'OK', false otherwise.

Returns
(boolean) True if traces were cleared successfully, false if the plugin did not return 'OK'
Note
Documentation generated by AI on 2026-03-04

◆ FDC_IsCapturing()

RapidPath FDC_IsCapturing ( )

Check whether an FDC capture or export session is currently active.

Queries two RapidPath I/O points: 'FDC:IsCapturing' (which goes high first when a capture starts) and 'FDC:IsExporting' (which goes low last when export finishes). Returns true if either I/O is active, so that callers can detect the full duration of an FDC session from start of capture through completion of file export.

Returns
(boolean) True if FDC capturing or exporting is currently in progress, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ FDC_ShowTraces()

RapidPath FDC_ShowTraces ( )

Display information about currently configured FDC traces in a message box.

Wraps _FDC_ShowTraces() with pcall error handling. If an error occurs, displays a message box describing the failure and re-raises via w.Error(). The inner implementation queries the plugin for the trace count and header data, then iterates over all configured traces to retrieve their info strings. If no traces are configured, shows a message indicating that. All results are concatenated and displayed in a single wxMessageBox.

Note
Documentation generated by AI on 2026-03-04

◆ FDC_StartCapture()

RapidPath FDC_StartCapture ( )

Start an FDC data capture session, optionally writing to a specified file.

Wraps _FDC_StartCapture() with pcall error handling. If an error occurs, displays a message box and re-raises via w.Error(). If capture_file is nil, sends the 'FDCStartCaptureFile' operation command with no file argument, using the plugin's default file naming. If capture_file is provided, appends it as a semicolon-delimited argument to the command.

Parameters
capture_file(string|nil) The output file path for captured data. If nil, uses the plugin default naming
Note
Documentation generated by AI on 2026-03-04

◆ FDC_StopCapture()

RapidPath FDC_StopCapture ( )

Stop an active FDC data capture session.

Wraps _FDC_StopCapture() with pcall error handling. If an error occurs in the underlying call, displays a message box describing the failure and re-raises the error via w.Error(). On success, sends the 'FDCStopCapture' operation command to the RapidPath plugin, which halts active data capture. The export process may continue after capture stops.

Note
Documentation generated by AI on 2026-03-04

◆ generator_feedback()

generator_feedback ( hIo )

Return a closure that reads the current state of a generic soft input I/O point.

Creates and returns a function that, when called, queries the Mach4 API for the current state of the I/O point identified by hIo and returns true if the state is non-zero. Used as the feedback function for generic soft input user commands so that button states reflect the current I/O state.

Parameters
hIo(number) The Mach4 I/O handle for the generic soft input point to monitor
Returns
(function) A closure that returns true if the I/O is active (non-zero), false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ generator_toggle()

generator_toggle ( hIo ,
io_path  )

Return a closure that toggles the specified generic soft input I/O point.

Creates and returns a function that, when called, reads the current state of the I/O point identified by hIo, then sends a 'SetGenericSoftInput' operation command to RapidPath to toggle it to the opposite state. The io_path parameter is captured in the closure for use in the command string. The returned function accepts a from_opr_panel parameter that is currently unused.

Parameters
hIo(number) The Mach4 I/O handle for the generic soft input point
io_path(string) The full I/O path string used in the SetGenericSoftInput command
Returns
(function) A closure that toggles the soft input when called
Note
Documentation generated by AI on 2026-03-04

◆ GetLoadPercent()

MotionController GetLoadPercent ( )

Get the load percentage for the specified axis from the RapidPath plugin.

Return the load percentage for a given axis.

Returns 0.0 immediately if the controller is defunct or not operational. Queries the master motor for the axis, returns 0.0 if that motor is virtual. Resolves and caches the motor torque percentage register handle on the first call for each axis; subsequent calls use the cached handle. If the handle cannot be resolved, returns 0 and logs a message.

Parameters
axis_id(number) The axis identifier for which to retrieve the load percentage
Returns
(number) The motor torque percentage (0-100) for the axis's master motor, or 0.0 on failure
See also
RapidPath:GetLoadRegister() for how the torque register path is determined
RapidPath:IsVirtualMotor() for the virtual motor check
MotionController:GetLoadPercent() for the base (always-zero) implementation
Note
Documentation generated by AI on 2026-03-04

Base implementation always returns 0, indicating load percentage reporting is not implemented. Subclasses (RapidPath) override this to query the motor torque percentage register for the axis's master motor, with caching of the register handle for efficiency.

Parameters
axis_id(number) The axis identifier for which to retrieve the load percentage
Returns
(number) Load percentage in the range 0-100; always 0 in the base implementation
See also
RapidPath:GetLoadPercent() for RapidPath-specific implementation
Note
Documentation generated by AI on 2026-03-04

◆ GetLoadRegister()

RapidPath GetLoadRegister ( )

Get the Mach4 register path for the load (torque percentage) of the given axis.

Retrieves the master motor for the axis and queries RapidPath for the motor's display name via GetMotorDisplayName(). If the motor ID is at or above MC_MAX_MOTORS, returns 0 immediately (Mach limitation). The load register path is constructed as '<DisplayName>/MotorTorquePct' and corresponds to the torque percentage reported by the drive.

Parameters
axis_id(number) The axis identifier whose load register path is requested
Returns
(string|number) The register path string for the motor torque percentage, or 0 if the motor ID is out of range
See also
RapidPath:GetMotorDisplayName() for display name resolution
RapidPath:GetLoadPercent() which uses this to resolve the register handle
Note
Documentation generated by AI on 2026-03-04

◆ GetMasterMotor()

MotionController GetMasterMotor ( )

Get the master (first) motor ID for the given axis.

Queries Mach4 for the first motor associated with the specified axis using mc.mcAxisGetMotorId(). Returns 0 if the motion controller is defunct or if the API call does not succeed. The master motor is used for load percentage queries and other per-axis motor operations.

Parameters
axis_id(number) The axis identifier whose master motor is requested
Returns
(number) The motor ID of the master motor for the axis, or 0 on failure
Note
Documentation generated by AI on 2026-03-04

◆ GetMotionDeviceName()

MotionController GetMotionDeviceName ( )

Retrieve the name of the motion device configured for the given Mach4 instance.

Reads the 'MotionDevice' key from the 'Preferences' section of the Mach4 machine profile using mc.mcProfileGetString(). Returns an empty string if the key is not set. This is used during controller creation to determine which subclass to instantiate.

Parameters
instance(number) The Mach4 instance handle to query
Returns
(string) The configured motion device name (e.g., 'HiCON', 'RapidPath', 'Sim0'), or empty string if not set
Note
Documentation generated by AI on 2026-03-04

◆ GetMotorCount()

RapidPath GetMotorCount ( )

Get the total number of motor devices controlled by the RapidPath plugin.

Sends a 'GetMotorDeviceCount' operation command to the RapidPath plugin via OpCmdReg() and returns the result as a number. If the API call fails, logs a message and returns 0.

Returns
(number) The count of motor devices reported by the RapidPath plugin, or 0 on failure
Note
Documentation generated by AI on 2026-03-04

◆ GetMotorDisplayName()

RapidPath GetMotorDisplayName ( )

Get the display name of the device associated with a RapidPath motor.

Returns a fallback string 'MotorN' immediately if the controller is defunct. Checks an internal cache first; if a cached entry exists and the device with that name is still registered in Mach4, returns the cached name. On cache miss or stale entry, sends a 'GetDisplayNameFromMotor;N' operation command to the RapidPath plugin. Raises an error if the plugin reports an invalid or empty name, or if no Mach4 device with the returned name can be found. Updates the cache with the resolved device handle and name on success.

Parameters
motor_id(number) The motor identifier whose display name is requested
Returns
(string) The display name of the device associated with the motor
Warning
Raises an error via w.Error() if the display name is invalid or the device cannot be found
Note
Results are cached by motor_id; cache may be stale after RapidPath reconfiguration
See also
RapidPath:Reconfig() to clear the cache after reconfiguration
Note
Documentation generated by AI on 2026-03-04

◆ GetName()

MotionController GetName ( )

Return the display name of this motion controller instance.

Returns the value of the 'name' field set during object creation. The name is assigned in each subclass Create() method and typically matches the device name string (e.g., 'HiCON', 'M31', 'RapidPath', 'Sim0').

Returns
(string) The name of this motion controller instance
Note
Documentation generated by AI on 2026-03-04

◆ HandleOperationStatus()

RapidPath HandleOperationStatus ( )

Monitor RapidPath plugin operational state and manage the operational status dialog.

Called periodically (from PLCScript) to verify that the RapidPath plugin is operational. Only executes for the leader instance (first plugin instance). When the plugin is not operational, disables the motion controller config button and shows a non-modal OpStatus dialog containing live status strings from the plugin registers. When the plugin becomes operational again, hides the dialog, re-enables the config button, and triggers a one-time safety relay reset. The OpStatus dialog provides level1/level2/level3 status strings, an optional action button for ENI file override confirmation, and routes log messages to the Mach diagnostic log.

Note
This function only manages the dialog for the leader instance; non-leader instances return immediately
Warning
Modifies UI state (button enabled/disabled) and may show/hide a modal-style dialog
See also
RapidPath:IsOperational() for the operational state check
RapidPath:IsLeader() to determine if this instance is the leader
Note
Documentation generated by AI on 2026-03-04

◆ Initialization()

Sim Initialization ( )

Perform Sim motion controller initialization at Mach4 startup.

Perform motion controller initialization at Mach4 startup.

Perform RapidPath motion controller initialization at Mach4 startup.

Perform TrioMotion motion controller initialization at Mach4 startup.

Perform DSPMC motion controller initialization at Mach4 startup.

Perform M31 motion controller initialization at Mach4 startup.

Perform HiCON motion controller initialization at Mach4 startup.

Returns immediately if the current instance is not instance 0 (UTI != 0). If Mach4 is in CONFIG state, returns without further action. Otherwise sets the stop status and displays a please-wait dialog (PleaseWaitType.TimeDelay) for 500 milliseconds while the system initializes. If the dialog is cancelled or times out, logs a function error and sets a warning message. On completion, disables the motion controller configuration button in the UI. If AutomaticallyConfigureEnableParameters is set to 'Yes', clears the HardwareEnable and DriveEnable OEM parameters to empty strings.

Warning
This function blocks execution for approximately 500 milliseconds during initialization
See also
Sim:Create() for controller object construction
HiCON:Initialization() for an equivalent hardware controller implementation
Note
Documentation generated by AI on 2026-03-04

Returns immediately if Mach4 is in CONFIG state. Otherwise sets the stop status and displays a please-wait dialog (PleaseWaitType.Register) waiting up to 10 seconds for the 'HiCON/StatusBits' register to become non-zero. If the dialog is cancelled or times out, sets a warning message. On success, enables the motion controller configuration button and optionally configures the HardwareEnable and DriveEnable OEM parameters if AutomaticallyConfigureEnableParameters is set to 'Yes'. Finally, calls ReadAbsoluteEncoderPositions() to synchronize absolute encoder motors.

Warning
This function blocks execution while waiting for controller firmware to initialize (up to 10 seconds)
See also
HiCON:IsInitialized() for the readiness check used after initialization
HiCON:ReadAbsoluteEncoderPositions() for the absolute encoder read performed at the end
Note
Documentation generated by AI on 2026-03-04

Returns immediately if Mach4 is in CONFIG state. Otherwise sets the stop status and displays a please-wait dialog (PleaseWaitType.Register) waiting up to 10 seconds for the 'M31/StatusBits' register to become non-zero. If the dialog is cancelled or times out, sets a warning message. On success, enables the motion controller configuration button and optionally configures the HardwareEnable and DriveEnable OEM parameters if AutomaticallyConfigureEnableParameters is set to 'Yes'.

Warning
This function blocks execution while waiting for controller firmware to initialize (up to 10 seconds)
See also
M31:IsInitialized() for the readiness check used after initialization
HiCON:Initialization() for the equivalent HiCON implementation
Note
Documentation generated by AI on 2026-03-04

Returns immediately if Mach4 is in CONFIG state. Otherwise sets the stop status and displays a please-wait dialog (PleaseWaitType.TimeDelay) for 500 milliseconds while the system initializes. If the dialog is cancelled or times out, sets a warning message. On completion, disables the motion controller configuration button in the UI.

Warning
This function blocks execution for approximately 500 milliseconds during initialization
See also
DSPMC:Create() for controller object construction
Note
Documentation generated by AI on 2026-03-04

Returns immediately if Mach4 is in CONFIG state. Otherwise sets the stop status and displays a please-wait dialog (PleaseWaitType.Register) waiting up to 10 seconds for the 'M31/StatusBits' register to become non-zero. If initialization times out or is cancelled, sets a warning message. On success, enables the motion controller config button and optionally configures the HardwareEnable and DriveEnable OEM parameters if AutomaticallyConfigureEnableParameters is set to 'Yes'.

Warning
This function blocks execution while waiting for controller firmware to initialize (up to 10 seconds)
See also
TrioMotion:IsInitialized() for the readiness check used after initialization
Note
Documentation generated by AI on 2026-03-04

Returns immediately if the controller is defunct or if Mach4 is in CONFIG state. Otherwise sets the stop status for the instance and calls OneTimeInitialization() to configure enable signal registers. Unlike other controller Initialization() methods, RapidPath does not show a please-wait dialog here; operational readiness is monitored asynchronously via PLCScript() and HandleOperationStatus().

Returns
(boolean) False after completing initialization steps; nil if in CONFIG state
Note
This method delegates operational readiness monitoring to PLCScript/HandleOperationStatus
See also
RapidPath:OneTimeInitialization() for the register configuration performed here
RapidPath:HandleOperationStatus() for ongoing operational state monitoring
Note
Documentation generated by AI on 2026-03-04

Base implementation sets the stop status and disables the motion controller configuration button in the UI. Subclasses override this to perform controller-specific initialization such as waiting for firmware startup via a please-wait dialog, configuring enable signal registers, and reading absolute encoder positions.

Warning
Subclass implementations may block execution while waiting for hardware to initialize
See also
HiCON:Initialization() for HiCON-specific startup sequence
RapidPath:Initialization() for RapidPath-specific startup sequence
Note
Documentation generated by AI on 2026-03-04

◆ InitializeGeneric()

MotionController InitializeGeneric ( )

Initialize generic motion controller profiling resources on first call.

Performs one-time setup of the MotionDataProfiler plugin interface. Resolves and caches the 'MotionDataProfiler/OperationalCommand' register handle, the 'IsProfilingActive' IOStateChecker, and the 'IsProfilingPaused' IOStateChecker. Subsequent calls are no-ops because each resource is only initialized when its field is nil.

Note
Documentation generated by AI on 2026-03-04

◆ InvokeDataViz()

MotionController InvokeDataViz ( )

Launch the MachMotion Data Visualization tool as an external process.

Constructs a command string that invokes VisualizeData.cmd from the Mach installation tools directory using cmd.exe, starting minimized. The result of os.execute() is logged. This is a blocking call that waits for the shell command to be dispatched; the visualizer itself runs as a separate process.

Note
Documentation generated by AI on 2026-03-04

◆ InvokeDataVizAsync()

MotionController InvokeDataVizAsync ( )

Launch the Data Visualizer asynchronously using a short-delay wxTimer.

Creates a wxEvtHandler and wxTimer that fires once after 100 milliseconds, at which point InvokeDataViz() is called to launch the visualizer script. After the timer fires the handler and timer objects are cleaned up. This avoids blocking the calling context while still ensuring the visualizer is opened promptly after capture is complete.

Note
Documentation generated by AI on 2026-03-04

◆ IOStateChecker()

MotionController ProfilingLib IOStateChecker ( inst ,
device_name ,
io_name  )

◆ is_operable()

fn_table is_operable ( obj ,
mc_obj  )

Check whether the RapidPath motion controller is currently operational.

Delegates to mc_obj:IsOperational() to determine if the RapidPath plugin is in a good state. Used by the OpStatus dialog to decide whether to keep showing the status notice or to dismiss it. Returns true when both the plugin FSM and RMP FSM report operational states.

Parameters
obj(table) The OpStatus object
mc_obj(table) The RapidPath motion controller object
Returns
(boolean) True if the RapidPath plugin is operational, false otherwise
Note
Documentation generated by AI on 2026-03-04

◆ IsAxisMotorAbsoluteEncoder()

MotionController IsAxisMotorAbsoluteEncoder ( )

Check whether any motor on the specified axis uses an absolute encoder (Sim).

Base implementation to check whether any motor on an axis uses an absolute encoder.

Check whether any motor on the specified axis uses an absolute encoder (RapidPath).

Check whether any motor on the specified axis uses an absolute encoder (HiCON).

Stub implementation for the Sim motion controller. This function is commented out in the source and was intended to return true unconditionally for testing purposes. The base MotionController:IsAxisMotorAbsoluteEncoder() implementation is used instead.

Parameters
axis_id(number) The axis identifier to check for absolute encoder motors
Returns
(boolean) True unconditionally (for testing purposes)
See also
HiCON:IsAxisMotorAbsoluteEncoder() for a production implementation
MotionController:IsAxisMotorAbsoluteEncoder() for the base implementation
Note
Documentation generated by AI on 2026-03-04

First checks whether the AbsoluteEncodersHiCONEnabled OEM parameter is set to 'Yes'. If not, returns false immediately. Otherwise, retrieves the list of child motor IDs for the axis via w.GetAxisChildMotorID() and checks the AbsoluteEncoderEnabledMotor{N} OEM parameter for each motor. Returns true if any motor reports 'Yes' for absolute encoder enablement.

Parameters
axis_id(number) The axis identifier to check for absolute encoder motors
Returns
(boolean) True if at least one child motor on the axis uses an absolute encoder, false otherwise
See also
HiCON:IsMotorAbsoluteEncoder() for the single-motor equivalent
RapidPath:IsAxisMotorAbsoluteEncoder() for the RapidPath-specific implementation
Note
Documentation generated by AI on 2026-03-04

Retrieves the list of child motor IDs for the axis via w.GetAxisChildMotorID(), then queries each motor's encoder type by sending a 'Motor;N,Get,EncoderType' command to the RapidPath plugin via w.eRegSendCommand(). Returns true if any motor reports 'Absolute' as its encoder type.

Parameters
axis_id(number) The axis identifier to check for absolute encoder motors
Returns
(boolean) True if at least one child motor on the axis uses an absolute encoder, false otherwise
See also
HiCON:IsAxisMotorAbsoluteEncoder() for the HiCON-specific implementation
Note
Documentation generated by AI on 2026-03-04

Logs a message indicating no method is implemented for the current motion controller type and returns false. Subclasses (HiCON, RapidPath) override this to iterate over the axis's child motors and query the controller-specific absolute encoder configuration.

Parameters
axis_id(number) The axis identifier to check for absolute encoder motors
Returns
(boolean) False in the base implementation; true in subclasses if any child motor uses an absolute encoder
See also
HiCON:IsAxisMotorAbsoluteEncoder() for HiCON-specific implementation
RapidPath:IsAxisMotorAbsoluteEncoder() for RapidPath-specific implementation
Note
Documentation generated by AI on 2026-03-04

◆ IsDefunct()

MotionController IsDefunct ( )

Check whether this motion controller object has been marked as defunct.

Returns the value of the 'defunct' field. A defunct controller is a valid object that will silently decline to perform operations. If the defunct field has never been set, returns false. Used to guard against operating on a controller whose plugin has failed.

Returns
(boolean) True if the controller is defunct, false otherwise
See also
MotionController:SetDefunct() to mark a controller as defunct
Note
Documentation generated by AI on 2026-03-04

◆ IsDisconnectedMotor()

RapidPath IsDisconnectedMotor ( )

Check whether a motor is currently disconnected in the RapidPath plugin.

Reads the 'DisconnectedMotor_N' register for the given motor ID from the RapidPath device. This reflects the committed (active) disconnection state of the motor. Returns false if the register cannot be read.

Parameters
motor_id(number) The motor identifier to check for disconnection
Returns
(boolean) True if the motor is disconnected, false otherwise
See also
RapidPath:IsDisconnectedMotor_Que() for the queued (pending) disconnection state
RapidPath:CommitMotorConnections() to apply staged disconnection changes
Note
Documentation generated by AI on 2026-03-04

◆ IsDisconnectedMotor_Que()

RapidPath IsDisconnectedMotor_Que ( )

Check whether a motor is queued for disconnection in the RapidPath plugin.

Reads the 'DisconnectedMotor_Que_N' register for the given motor ID from the RapidPath device. The 'Que' register reflects a pending (staged) disconnection state that has been marked via MarkSingleMotorConnection() but not yet committed. Returns false if the register cannot be read.

Parameters
motor_id(number) The motor identifier to check for a queued disconnection
Returns
(boolean) True if the motor is queued for disconnection, false otherwise
See also
RapidPath:IsDisconnectedMotor() for the committed disconnection state
RapidPath:MarkSingleMotorConnection() to stage a disconnection
Note
Documentation generated by AI on 2026-03-04

◆ IsEnableSequenceFinished()

MotionController IsEnableSequenceFinished ( )

Check whether the machine enable sequence has finished for RapidPath.

Check whether the machine enable sequence has finished.

Extends the base MotionController implementation by additionally requiring that the RapidPath 'IsServoArmed' I/O is active. Reads the MachMotion register 'mm_MachineEnableScriptRunning' to verify the enable script has completed (value == 0), and reads the RapidPath 'IsServoArmed' I/O state to verify drives have armed. Returns true only when both conditions are satisfied simultaneously.

Returns
(boolean) True if the enable script has finished and RapidPath servos are armed, false otherwise
Warning
Raises an error via w.Error() if either register or I/O cannot be read
See also
MotionController:IsEnableSequenceFinished() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Queries the MachMotion register 'mm_MachineEnableScriptRunning' to determine whether the machine enable script is still executing. Returns true only when the script is no longer running (register value is 0). Raises an error if the register cannot be read. RapidPath overrides this to additionally check the 'IsServoArmed' I/O state.

Returns
(boolean) True if the enable sequence has completed, false if still in progress
Warning
Raises an error via w.Error() if the MachMotion register cannot be read
See also
RapidPath:IsEnableSequenceFinished() for RapidPath-specific implementation
Note
Documentation generated by AI on 2026-03-04

◆ IsInitialized()

HiCON IsInitialized ( )

Check whether the HiCON motion controller has completed initialization.

Check whether the motion controller has completed initialization and is ready.

Check whether the RapidPath motion controller has completed initialization.

Check whether the TrioMotion controller has completed initialization.

Check whether the M31 motion controller has completed initialization.

Reads the 'StatusBits' register from the 'HiCON' device for this instance and returns true if the value is non-zero, indicating the controller firmware has completed its startup sequence. Returns false if the register cannot be read.

Returns
(boolean) True if StatusBits is non-zero (controller ready), false otherwise
See also
HiCON:Initialization() for the startup sequence that precedes this check
M31:IsInitialized() for the equivalent M31 implementation
Note
Documentation generated by AI on 2026-03-04

Reads the 'StatusBits' register from the 'M31' device for this instance and returns true if the value is non-zero, indicating the controller firmware has completed its startup sequence. Returns false if the register cannot be read.

Returns
(boolean) True if StatusBits is non-zero (controller ready), false otherwise
See also
M31:Initialization() for the startup sequence that precedes this check
HiCON:IsInitialized() for the equivalent HiCON implementation
Note
Documentation generated by AI on 2026-03-04

Reads the 'StatusBits' register from the 'M31' device for this instance and returns true if the value is non-zero, indicating the controller firmware has completed its startup sequence. Returns false if the register cannot be read.

Returns
(boolean) True if StatusBits is non-zero (controller ready), false otherwise
See also
M31:IsInitialized() for the equivalent M31 implementation
Note
Documentation generated by AI on 2026-03-04

Delegates directly to IsOperational() to determine if the plugin is in a ready state. The controller is considered initialized when both the plugin FSM and the RMP FSM report operational states.

Returns
(boolean) True if the RapidPath plugin is operational and ready, false otherwise
See also
RapidPath:IsOperational() for the underlying operational state check
Note
Documentation generated by AI on 2026-03-04

Base implementation always returns true, indicating the controller is considered initialized by default. Subclasses (HiCON, M31, TrioMotion) override this to check a hardware status register (e.g., 'StatusBits') for a non-zero value indicating the controller firmware has completed its startup sequence.

Returns
(boolean) True in the base implementation; subclasses return true only when hardware reports ready
Note
Documentation generated by AI on 2026-03-04

◆ IsLeader()

RapidPath IsLeader ( )

Determine whether this RapidPath plugin instance is the leader instance.

Queries the RapidPath plugin via OperationCommand('GetLeaderInstance') to retrieve the instance number of the designated leader. Caches the result after the first call. The leader instance is responsible for showing the operational status dialog and other singleton operations that should only occur once across all plugin instances.

Returns
(boolean) True if this instance's number matches the leader instance, false otherwise
Note
Result is cached after the first call; subsequent calls return the cached value
Documentation generated by AI on 2026-03-04

◆ IsMotorAbsoluteEncoder()

MotionController IsMotorAbsoluteEncoder ( )

Check whether the specified motor uses an absolute encoder on the HiCON controller.

Base implementation to check whether a specific motor uses an absolute encoder.

First checks whether the AbsoluteEncodersHiCONEnabled OEM parameter is set to 'Yes'. If not, returns false immediately. Otherwise, reads the AbsoluteEncoderEnabledMotor{N} OEM parameter for the given motor ID and returns true if its value is 'Yes'.

Parameters
motor_id(number) The motor identifier to check for absolute encoder configuration
Returns
(boolean) True if the motor is configured to use an absolute encoder, false otherwise
See also
HiCON:IsAxisMotorAbsoluteEncoder() for the axis-level equivalent
MotionController:IsMotorAbsoluteEncoder() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Logs a message indicating no method is implemented for the current motion controller type and returns false. Subclasses (HiCON) override this to query the OEM parameter 'AbsoluteEncoderEnabledMotor{N}' for the given motor ID.

Parameters
motor_id(number) The motor identifier to check for absolute encoder configuration
Returns
(boolean) False in the base implementation; true in subclasses if the motor uses an absolute encoder
See also
HiCON:IsMotorAbsoluteEncoder() for HiCON-specific implementation
Note
Documentation generated by AI on 2026-03-04

◆ IsOperational()

RapidPath IsOperational ( )

Check whether the RapidPath plugin is in a good operational state.

Reads the string values of both the plugin FSM state register (_plugin_fsm) and the RMP (RapidPath Motion Platform) FSM state register (_rmp_fsm). Returns true only when the plugin FSM state is one of the recognized operational states (Operational, Enabling, Disabling, Enabled, Configuration) AND the RMP FSM reports 'Operational'.

Returns
(boolean) True if both FSMs report acceptable operational states, false otherwise
Note
The recognized plugin FSM states are defined in RapidPath.OperationalStates
Documentation generated by AI on 2026-03-04

◆ IsVirtualMotor()

RapidPath IsVirtualMotor ( )

Check whether the specified motor is a virtual (non-physical) motor in RapidPath.

Sends an 'IsVirtualMotor;N' operation command to the RapidPath plugin and interprets the result. Caches the result for each motor ID to avoid repeated plugin queries. A motor is considered virtual if the result cannot be parsed as a number, or if the numeric result is non-zero. Returns false only when the plugin explicitly returns '0'.

Parameters
motor_id(number) The motor identifier to check
Returns
(boolean) True if the motor is virtual, false if it is a physical motor
Note
Result is cached after the first call for each motor_id; subsequent calls return the cached value
Documentation generated by AI on 2026-03-04

◆ level1()

fn_table level1 ( obj ,
mc_obj  )

Provide the plugin action status string for the OpStatus dialog.

Reads and returns the current string value of the 'OpStat_Level1' RapidPath register, which contains the plugin-level action description reported by the plugin during initialization or error states. Used by the OpStatus dialog to display what the RapidPath plugin is currently doing.

Parameters
obj(table) The OpStatus object
mc_obj(table) The RapidPath motion controller object
Returns
(string) The current Level1 status string from the RapidPath plugin
Note
Documentation generated by AI on 2026-03-04

◆ level2()

fn_table level2 ( obj ,
mc_obj  )

Provide the controller action status string for the OpStatus dialog.

Reads and returns the current string value of the 'OpStat_Level2' RapidPath register, which contains the controller-level action description reported by the plugin during initialization or error states. Used by the OpStatus dialog to display what the motion controller is currently doing.

Parameters
obj(table) The OpStatus object
mc_obj(table) The RapidPath motion controller object
Returns
(string) The current Level2 status string from the RapidPath plugin
Note
Documentation generated by AI on 2026-03-04

◆ level3()

fn_table level3 ( obj ,
mc_obj  )

Provide the detail-level 3 status string for the OpStatus dialog.

Reads and returns the current string value of the 'OpStat_Level3' RapidPath register, which contains the lowest-level detail status description reported by the plugin during initialization or error states. Used by the OpStatus dialog to display extended diagnostic information to the operator.

Parameters
obj(table) The OpStatus object
mc_obj(table) The RapidPath motion controller object
Returns
(string) The current Level3 status string from the RapidPath plugin
Note
Documentation generated by AI on 2026-03-04

◆ log()

fn_table log ( obj_args ,
fmt ,
... )

Log function for the OpStatus dialog, routing messages to the Mach diagnostic log.

Formats a log message with a prefix identifying the OpStatus instance ID and name, then writes it to the Mach4 diagnostic log via w.Log(). The obj_args parameter is a table where obj_args[1] is the OpStatus object and obj_args[2] is the motion controller object.

Parameters
obj_args(table) Array where [1] is the OpStatus object and [2] is the MotionController object
fmt(string) Format string for the log message
...(any) Arguments for the format string
Note
Documentation generated by AI on 2026-03-04

◆ LogF()

RapidPath LogF ( ...)

Write a formatted log message to the Mach4 diagnostic log for this RapidPath instance.

Formats the message string using string.format if additional arguments are provided, then prepends a '[RapidPath#N] ' prefix identifying the instance. Uses debug.getinfo() to capture the caller's source file and line number for accurate log attribution. If the caller info is unavailable or unresolved, the file name is prefixed with '*'. Writes the final message via mc.mcCntlLog().

Parameters
fmt(string) A format string for the log message
...(any) Optional arguments for string.format applied to fmt
Note
Documentation generated by AI on 2026-03-04

◆ MarkCommitMultipleMotorConnections()

RapidPath MarkCommitMultipleMotorConnections ( discon_flgs )

Mark and immediately commit connection changes for multiple motors (untested).

This function was written but not ultimately used and has not been tested. It is intended to stage and atomically commit connection/disconnection changes for a list of motors in a single operation using 'MarkCommitMultipleMotorConnections'. Validates that motor_ids and discon_flgs have the same length and that each element is the correct type before sending the command. Returns a status string from the plugin.

Parameters
motor_ids(table) Array of motor ID numbers to update
discon_flgs(table) Array of boolean disconnection flags, one per motor_id
Returns
(string) Plugin response: 'INVALID_NUMBER_PARAMETERS', 'INVALID_ARGUMENTS', 'OK', or 'NO_CHANGE'
Warning
This function is untested and was not used in production code
See also
RapidPath:MarkCommitSingleMotorConnection() for the single-motor equivalent
Note
Documentation generated by AI on 2026-03-04

◆ MarkCommitSingleMotorConnection()

RapidPath MarkCommitSingleMotorConnection ( discon )

Mark and immediately commit a single motor connection or disconnection change.

Combines MarkSingleMotorConnection() and CommitMotorConnections() into a single atomic operation for one motor. Validates that the machine is disabled before proceeding. Checks that no configuration operation is currently in progress via the 'ConfigRequestCount' register. Validates that motor_id is a number and discon is a boolean, then sends a 'MarkCommitSingleMotorConnection;N,0|1' command to the RapidPath plugin.

Parameters
motor_id(number) The motor identifier whose connection state should be changed and committed
discon(boolean) True to disconnect the motor, false to reconnect it
Returns
(string) Plugin response: 'INVALID_NUMBER_OF_PARAMETERS', 'INVALID_ARGUMENTS', 'OK', 'NO_CHANGE', 'REG_ERROR', or 'API ERROR'
Warning
Machine must be disabled before calling; raises an error and displays a message box if enabled
See also
RapidPath:MarkSingleMotorConnection() to stage without committing
RapidPath:CommitMotorConnections() to commit previously staged changes
Note
Documentation generated by AI on 2026-03-04

◆ MarkSingleMotorConnection()

RapidPath MarkSingleMotorConnection ( discon )

Stage a single motor connection or disconnection change without committing it.

Validates that the machine is disabled before proceeding. Checks that no configuration operation is currently in progress via the 'ConfigRequestCount' register. Validates that motor_id is a number and discon is a boolean. Sends a 'MarkSingleMotorConnection;N,0|1' command to the RapidPath plugin via OpCmdReg() to queue the change. The change does not take effect until CommitMotorConnections() is called.

Parameters
motor_id(number) The motor identifier whose connection state should be staged for change
discon(boolean) True to queue a disconnection, false to queue a reconnection
Returns
(string) Plugin response: 'INVALID_NUMBER_PARAMETERS', 'INVALID_ARGUMENTS', 'OK', 'NO_CHANGE', 'REG_ERROR', or 'API ERROR'
Warning
Machine must be disabled before calling; raises an error and displays a message box if enabled
See also
RapidPath:CommitMotorConnections() to apply staged changes
RapidPath:RollbackMotorConnections() to discard staged changes
RapidPath:MarkCommitSingleMotorConnection() to stage and commit in one step
Note
Documentation generated by AI on 2026-03-04

◆ MotionSync()

HiCON MotionSync ( )

Synchronize the HiCON motion controller's internal position to the encoder positions.

Base implementation to perform a motion sync on the motion controller.

Synchronize the M31 motion controller's internal position to the encoder positions.

Counts the number of enabled coordinate axes. If fewer than 6 are enabled, sets the HiCON 'AXIS_DISABLE_BITS' register to 95488+63 to disable axes before syncing. Clears any active command by sending an empty string to the Command register, then sends the 'motion_sync' command. If axes were disabled, re-enables them by setting AXIS_DISABLE_BITS back to 0. Raises an error via w.FunctionError() if any register operation fails.

Warning
This temporarily disables axes when fewer than 6 coordinate axes are enabled
See also
HiCON:UpdateMotorMapping() for the related motor mapping update operation
M31:MotionSync() for the equivalent M31 implementation
Note
Documentation generated by AI on 2026-03-04

Counts the number of enabled coordinate axes. If fewer than 6 are enabled, sets the M31 'AXIS_DISABLE_BITS' register to 95488+63 to disable axes before syncing. Clears any active command by sending an empty string to the Command register, then sends the 'motion_sync' command. If axes were disabled, re-enables them by setting AXIS_DISABLE_BITS back to 0. Raises an error via w.FunctionError() if any register operation fails.

Warning
This temporarily disables axes when fewer than 6 coordinate axes are enabled
See also
M31:UpdateMotorMapping() for the related motor mapping update operation
HiCON:MotionSync() for the equivalent HiCON implementation
Note
Documentation generated by AI on 2026-03-04

Logs a message indicating no method is implemented for the current motion controller type. Subclasses (HiCON, M31) override this to synchronize the controller's internal position to the encoder positions by disabling axes, sending a 'motion_sync' command, and re-enabling axes.

Note
Documentation generated by AI on 2026-03-04

◆ OneTimeInitialization()

RapidPath OneTimeInitialization ( )

Perform one-time startup initialization for the RapidPath motion controller.

Guards against repeated execution using the _one_time_initialization flag. Reads the 'AutomaticallyConfigureEnableParameters' OEM parameter and, if set to 'Yes', configures the 'DriveEnable' OEM parameter to point to the RapidPath 'ServoArm' I/O for the current instance. This wires the Mach4 drive enable signal to the RapidPath servo arm output. Called from Initialization() and, where needed, from HandleOperationStatus().

Note
This function is a no-op after the first call; subsequent calls return immediately
See also
RapidPath:OneTimeOperationalInitialization() for initialization requiring the plugin to be running
Note
Documentation generated by AI on 2026-03-04

◆ OneTimeOperationalInitialization()

RapidPath OneTimeOperationalInitialization ( )

Perform one-time initialization that requires RapidPath to be operational.

Guards against repeated execution using the _one_time_opnl_init flag. When the RapidPath plugin is first detected as operational, queries the plugin for the count of generic soft inputs and creates toggle user commands for each. Each command uses a cached I/O handle and io_path string captured in closures via generator_feedback() and generator_toggle(). After creating all commands, calls w.WriteCommandFile() to update the dashboard command list. This initialization is deferred because generic soft input I/O points do not exist until the plugin is running.

Note
This function is a no-op after the first call; subsequent calls return immediately
See also
RapidPath:OneTimeInitialization() for initialization that does not require the plugin to be operational
Note
Documentation generated by AI on 2026-03-04

◆ OpCmdReg()

RapidPath OpCmdReg ( )

Get or resolve and cache the operational command register handle for a RapidPath instance.

Returns the cached register handle for the 'cmd_Operation' register on the specified instance. If inst is nil, uses self.instance. On cache miss, resolves the handle via ResolveRPRegister() and stores it in the _op_cmd table keyed by instance number.

Parameters
inst(number|nil) The Mach4 instance to get the command register for. If nil, uses self.instance
Returns
(number) The Mach4 register handle (HMCREG) for the operational command register
See also
RapidPath:ResolveRPRegister() for handle resolution
RapidPath:OperationCommand() which uses this register to send commands
Note
Documentation generated by AI on 2026-03-04

◆ OpenConfiguration()

Sim OpenConfiguration ( )

Open the Sim motion controller configuration window.

Base implementation to open the motion controller configuration UI.

Open the RapidPath motion controller configuration window.

Open the M31 motion controller configuration window.

Open the HiCON motion controller configuration window.

This operation is not possible for the Sim controller and silently does nothing. No configuration UI exists for the simulator motion controller type.

See also
HiCON:OpenConfiguration() for a hardware controller implementation
MotionController:OpenConfiguration() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Returns immediately if the controller is defunct. Writes the value 1 to the 'HiCON_Config' register on the HiCON device via w.eSetRegValue() to trigger the plugin to open its configuration UI. Nothing is returned.

See also
M31:OpenConfiguration() for the equivalent M31 implementation
MotionController:OpenConfiguration() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Returns immediately if the controller is defunct. Writes the value 1 to the 'M31_Config' register on the M31 device via w.eSetRegValue() to trigger the plugin to open its configuration UI. Nothing is returned.

See also
HiCON:OpenConfiguration() for the equivalent HiCON implementation
MotionController:OpenConfiguration() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Returns immediately if the controller is defunct. Sends a 'Configuration;Open' operation command to the RapidPath plugin. If the plugin does not return 'OK', raises an error via w.Error() with a descriptive message. On success, the plugin opens its configuration UI window.

Warning
Raises an error via w.Error() if the configuration open command fails
See also
MotionController:OpenConfiguration() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Logs a message indicating no configuration open method is implemented for the current motion controller type. Subclasses (HiCON, M31, RapidPath) override this to trigger the controller-specific configuration window, typically by writing to a dedicated configuration register or sending an operation command.

Note
Documentation generated by AI on 2026-03-04

◆ OperationCommand()

RapidPath OperationCommand ( target_instance )

Send an operation command to the RapidPath plugin and return the result.

Returns 'DEFUNCT' immediately if the controller has been marked defunct. Logs the command string and the result string via LogF() before returning. The command is sent to the operational command register for the specified target instance via w.api('mcRegSendCommand'). If target_instance is nil, uses the register for the controller's own instance.

Parameters
command(string) The operation command string to send to the RapidPath plugin
target_instance(number|nil) The Mach4 instance to target. If nil, uses self.instance
Returns
(string) The result string returned by the RapidPath plugin, or 'DEFUNCT' if the controller is defunct
Note
Documentation generated by AI on 2026-03-04

◆ ParseMCodeCategory_G()

MotionController ParseMCodeCategory_G ( )

Parse an M-code numeric category value into its corresponding string name.

Converts the numeric category parameter from an M-code invocation to the corresponding string identifier used internally. Currently maps category 0 to 'MotionDataProfiler'. If the input is not a recognized integer, it is returned as-is. Returns nil for unrecognized integer values.

Parameters
category(number|string) The category value from the M-code parameter
Returns
(string|nil) The string category name, the original value if non-integer, or nil if unrecognized integer
See also
RapidPath:ParseMCodeCategory_RP() for RapidPath-specific category parsing
Note
Documentation generated by AI on 2026-03-04

◆ ParseMCodeCategory_RP()

RapidPath ParseMCodeCategory_RP ( )

Convert from the numeric value for category (used in the M codes) to the corresponding string name.

Convert a numeric M-code category value to its RapidPath string category name

Maps numeric category identifiers (as passed from M-code parameters) to the corresponding RapidPath profiling category string. Recognized mappings: 100='MotionDataProfiling', 101='MotionLoopProfiling', 102='VerboseLogFile', 110='FirmwareData+Motion', 111='FirmwareData+Probing', 112='FirmwareData+Homing'. Non-integer values are returned as-is. Unrecognized integer values are returned unchanged.

Parameters
category(number|string) The category value from the M-code parameter
Returns
(string) The string category name, or the original value if non-integer or unrecognized
See also
MotionController:ParseMCodeCategory_G() for generic (non-RapidPath) category parsing
Note
Documentation generated by AI on 2026-03-04

◆ ParseNewState()

MotionController ProfilingLib ParseNewState ( new_state ,
feedback  )

◆ PLCScript()

HiCON PLCScript ( )

PLC script callback for HiCON motion controller periodic housekeeping.

Called periodically from the Mach4 PLC script for motion controller housekeeping.

PLC script callback for RapidPath motion controller periodic housekeeping.

Called periodically from the Mach4 PLC script. Manages the HiCON analog spindle output if HiCONAnalogOutputSpindleEnabled is set to 'Yes'. When enabled, ensures the spindle enable output signal is active, synchronizes the commanded spindle RPM from the analog output speed register, and updates the spindle direction (FWD, REV, or OFF) based on the forward and reverse input signals.

Note
Documentation generated by AI on 2026-03-04

Called periodically from the Mach4 PLC script. Delegates to HandleOperationStatus() to monitor the plugin's operational state and manage the operational status dialog. When the plugin reports as operational, triggers OneTimeOperationalInitialization() to register generic soft input user commands that require the plugin to be running.

Note
Documentation generated by AI on 2026-03-04

Base implementation does nothing. Subclasses (HiCON, RapidPath) override this to perform periodic tasks such as handling analog spindle output, monitoring operational status dialogs, and triggering one-time operational initialization when the controller becomes ready.

Note
Documentation generated by AI on 2026-03-04

◆ PostHoming()

MotionController PostHoming ( )

Perform post-homing signal cleanup for the HiCON motion controller.

Base implementation of post-homing cleanup for the motion controller.

Perform post-homing signal cleanup for the M31 motion controller.

Called after the homing sequence completes for a given axis. Clears the jog inhibit, MPG inhibit, and motion inhibit signals to restore normal motion and jog behavior after homing is complete.

Parameters
axis_id(number) The axis identifier that has completed homing
See also
HiCON:PreHoming() for the inhibit setup performed before homing
HiCON:WaitForHomingToComplete() for the intermediate wait step
Note
Documentation generated by AI on 2026-03-04

Called after the homing sequence completes for a given axis. Clears the jog inhibit, MPG inhibit, and motion inhibit signals to restore normal motion and jog behavior after homing is complete.

Parameters
axis_id(number) The axis identifier that has completed homing
See also
M31:PreHoming() for the inhibit setup performed before homing
M31:WaitForHomingToComplete() for the intermediate wait step
Note
Documentation generated by AI on 2026-03-04

Called after the homing sequence completes for a given axis. The base implementation logs a message indicating no method is implemented. Subclasses (HiCON, M31, etc.) override this to release inhibit signals and restore normal motion/jog behavior after homing.

Parameters
axis_id(number) The axis identifier that has completed homing
Note
Documentation generated by AI on 2026-03-04

◆ PreDriveEnable()

MotionController PreDriveEnable ( )

Base implementation of pre-drive-enable actions for the motion controller.

Called before the drive enable signal is asserted. The base implementation logs a message indicating no method is implemented. Subclasses may override this to perform controller-specific preparatory actions required before drives are enabled.

Note
Documentation generated by AI on 2026-03-04

◆ PreEnableReset()

MotionController PreEnableReset ( )

Re-read absolute encoder positions before a machine enable reset on the HiCON controller.

Base implementation of pre-enable-reset actions for the motion controller.

Checks whether the machine is currently disabled. If the machine is not enabled, calls ReadAbsoluteEncoderPositions() to re-synchronize motor positions from the absolute encoders before the enable reset proceeds. This ensures position accuracy after a drive power cycle or fault reset.

See also
HiCON:ReadAbsoluteEncoderPositions() for the encoder read operation
MotionController:PreEnableReset() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Called before a machine enable reset is performed. The base implementation logs a message indicating no method is implemented. Subclasses (HiCON) override this to perform controller-specific actions such as re-reading absolute encoder positions when the machine is not currently enabled.

Note
Documentation generated by AI on 2026-03-04

◆ PreHoming()

MotionController PreHoming ( )

Perform pre-homing signal setup for the HiCON motion controller.

Base implementation of pre-homing setup for the motion controller.

Perform pre-homing signal setup for the M31 motion controller.

Called before beginning the homing sequence for a given axis. Sets the jog inhibit signal (twice for reliability) and the motion inhibit signal to prevent interference from jogging or other motion commands during the homing operation.

Parameters
axis_id(number) The axis identifier about to be homed
See also
HiCON:WaitForHomingToComplete() for the intermediate wait step
HiCON:PostHoming() for the cleanup performed after homing
Note
Documentation generated by AI on 2026-03-04

Called before beginning the homing sequence for a given axis. Sets the jog inhibit signal (twice for reliability) and the motion inhibit signal to prevent interference from jogging or other motion commands during the homing operation.

Parameters
axis_id(number) The axis identifier about to be homed
See also
M31:WaitForHomingToComplete() for the intermediate wait step
M31:PostHoming() for the cleanup performed after homing
Note
Documentation generated by AI on 2026-03-04

Called before beginning the homing sequence for a given axis. The base implementation logs a message indicating no method is implemented. Subclasses (HiCON, M31) override this to set jog inhibit and motion inhibit signals to prevent interference during homing.

Parameters
axis_id(number) The axis identifier about to be homed
Note
Documentation generated by AI on 2026-03-04

◆ Profiling_PopulateCategoryInfo()

RapidPath Profiling_PopulateCategoryInfo ( )

◆ progress()

fn_table progress ( obj ,
mc_obj  )

Provide progress pulse information for the OpStatus dialog.

Returns nil unconditionally, indicating that no progress bar or pulse animation is provided for the RapidPath operational status dialog. The OpStatus module interprets a nil return as 'no progress to display'.

Parameters
obj(table) The OpStatus object
mc_obj(table) The RapidPath motion controller object
Returns
(nil) Always returns nil
Note
Documentation generated by AI on 2026-03-04

◆ ReadAbsoluteEncoderPositions()

HiCON ReadAbsoluteEncoderPositions ( )

Read absolute encoder positions for all configured motors on the HiCON controller.

Returns immediately if AbsoluteEncodersHiCONEnabled is not set to 'Yes'. Otherwise, temporarily disables drive enable and machine enable to allow encoder communication. For each motor with AbsoluteEncoderEnabledMotor{N} set to 'Yes', sends a SETUP_ABSENC_AXIS_PARAM command with counts-per-revolution and origin offset, then executes EXEC_ABSENC_READ_CMD to read all configured encoders via Port 15 Pin 0. For each successfully read motor, marks the associated axis as homed via mc.mcAxisHomeComplete() and sets the home order to 0 to prevent Mach4 from re-homing. Waits for firmware/plugin synchronization after setup and after reading.

Warning
Temporarily disables drive enable and machine enable during the encoder read sequence
See also
HiCON:IsMotorAbsoluteEncoder() to check individual motor configuration
HiCON:Initialization() which calls this function during startup
Note
Documentation generated by AI on 2026-03-04

◆ ReadSDO()

RapidPath ReadSDO ( subindex ,
device_spec ,
byte_count  )

◆ Reconfig()

RapidPath Reconfig ( )

Invalidate cached data after a Mach4 or motion controller reconfiguration.

Called when Mach4 or the motion controller configuration may have changed.

Discards the cached load register handle table and the virtual motor status cache. Called when Mach4 or anything pertaining to the motion controller has been potentially reconfigured, ensuring that stale register handles and motor classification results are not used after a configuration change.

See also
MotionController:Reconfig() for the base (no-op) implementation
Note
Documentation generated by AI on 2026-03-04

Base implementation does nothing. Subclasses (RapidPath) override this to discard cached data that may be stale after a reconfiguration, such as cached load register handles and virtual motor status entries.

See also
RapidPath:Reconfig() for RapidPath-specific cache invalidation
Note
Documentation generated by AI on 2026-03-04

◆ ResetAlarms()

RapidPath ResetAlarms ( )

Wait for RapidPath drives to become operable and clear any active drive alarms.

Base implementation to reset drive alarms on the motion controller.

Returns immediately if the controller is defunct. If the RapidPath 'Operable' I/O is not active, displays a please-wait dialog (PleaseWaitType.IO) waiting up to 10 seconds for the drives to become operable (e.g., after a drive reboot following a fault reset). If the timeout or cancellation occurs, sets a warning message and returns early. This function is typically called as part of the machine enable reset sequence.

Warning
This function blocks execution while waiting for drives to become operable (up to 10 seconds)
See also
MotionController:ResetAlarms() for the base implementation (no-op)
Note
Documentation generated by AI on 2026-03-04

Does nothing in the base implementation. Subclasses (RapidPath) override this to wait for drives to become operable after a reset and clear any active drive fault conditions before allowing the machine to be re-enabled.

See also
RapidPath:ResetAlarms() for RapidPath-specific implementation
Note
Documentation generated by AI on 2026-03-04

◆ ResetSafetyRelay()

RapidPath ResetSafetyRelay ( )

Send a reset command to the RapidPath safety relay watchdog.

Base implementation to reset the safety relay on the motion controller.

Sends a 'ResetSafetyRelay' operation command to the RapidPath plugin for the current instance. Raises an error via w.Error() if the plugin does not return 'OK'. On success, calls w.FunctionCompleted() to log a completion message. This initializes the watchdog I/O for the safety relay circuit, typically called after the plugin becomes operational.

Warning
Raises an error via w.Error() if the safety relay reset command fails
See also
RapidPath:HandleOperationStatus() which triggers this after the plugin becomes operational
Note
Documentation generated by AI on 2026-03-04

Does nothing in the base implementation. Subclasses (RapidPath) override this to send a 'ResetSafetyRelay' operation command to the plugin, which initializes the watchdog I/O for the safety relay circuit.

See also
RapidPath:ResetSafetyRelay() for RapidPath-specific implementation
Note
Documentation generated by AI on 2026-03-04

◆ ResolveRPIO()

RapidPath ResolveRPIO ( inst )

Resolve a named RapidPath I/O point to its Mach4 handle.

Calls w.pcall(w.api, 'mcIoGetHandle') to look up the I/O handle for the path '<_reg_dev>/<io_name>' on the specified instance. If inst is nil, uses self.instance. If the call fails, logs a message indicating the plugin appears defunct, marks the controller as defunct if the failing instance matches self.instance, and raises an error via w.Error() with the failure details.

Parameters
io_name(string) The name of the RapidPath I/O point to resolve
inst(number|nil) The Mach4 instance to query. If nil, uses self.instance
Returns
(number) The Mach4 I/O handle (HMCIO) for the resolved I/O point
Warning
Raises an error via w.Error() if the I/O handle cannot be resolved; marks controller as defunct
See also
RapidPath:ResolveRPRegister() for resolving register handles
Note
Documentation generated by AI on 2026-03-04

◆ ResolveRPRegister()

RapidPath ResolveRPRegister ( inst )

Resolve a named RapidPath register to its Mach4 handle.

Calls w.pcall(w.api, 'mcRegGetHandle') to look up the register handle for the path '<_reg_dev>/<reg_name>' on the specified instance. If inst is nil, uses self.instance. If the call fails, logs a message indicating the plugin appears defunct, marks the controller as defunct if the failing instance matches self.instance, and raises an error via w.Error() with the failure details. The actual HMCREG handle is returned via the second return value of w.pcall (stored in errmsg).

Parameters
reg_name(string) The name of the RapidPath register to resolve
inst(number|nil) The Mach4 instance to query. If nil, uses self.instance
Returns
(number) The Mach4 register handle (HMCREG) for the resolved register
Warning
Raises an error via w.Error() if the register handle cannot be resolved; marks controller as defunct
See also
RapidPath:ResolveRPIO() for resolving I/O handles
Note
Documentation generated by AI on 2026-03-04

◆ RollbackMotorConnections()

RapidPath RollbackMotorConnections ( )

Discard all staged (queued) motor connection changes without applying them.

Validates that the machine is disabled and that no configuration operation is currently in progress via the 'ConfigRequestCount' register. Sends a 'RollbackMotorConnections' operation command to the RapidPath plugin via OpCmdReg() to undo any pending changes staged by MarkSingleMotorConnection(). If the machine is enabled, displays a message box and raises an error. If the API call fails, logs a message and returns 'API ERROR'.

Returns
(string) Plugin response: 'OK', 'NO_CHANGE', 'REG_ERROR', or 'API ERROR'
Warning
Machine must be disabled before calling; raises an error and displays a message box if enabled
See also
RapidPath:CommitMotorConnections() to apply staged changes instead of discarding them
RapidPath:MarkSingleMotorConnection() to stage a connection change
Note
Documentation generated by AI on 2026-03-04

◆ SetAxisMotorsManualModeOff()

MotionController SetAxisMotorsManualModeOff ( )

Disable manual mode for a specific axis's motors on the HiCON controller.

Base implementation to disable manual mode for a specific axis's motors.

Disable manual mode for a specific axis's motors on the M31 controller.

Retrieves the child motor IDs for the specified axis, then clears the corresponding bits in the HiCON 'AXIS_DISABLE_BITS' register to return the motors to normal servo control. If after clearing all motor bits the register value equals 95488 (the reserved mask for non-coordinate axes), it is reset to 0. Raises an error via w.Error() if any register operation fails.

Parameters
axis_id(number) The axis identifier whose motors should be taken out of manual mode
See also
HiCON:SetAxisMotorsManualModeOn() for placing motors into manual mode
HiCON:SupportsManualModeFeature() to check if manual mode is supported
Note
Documentation generated by AI on 2026-03-04

Retrieves the child motor IDs for the specified axis, then clears the corresponding bits in the M31 'AXIS_DISABLE_BITS' register to return the motors to normal servo control. If after clearing all motor bits the register value equals 95488 (the reserved mask for non-coordinate axes), it is reset to 0. Raises an error via w.Error() if any register operation fails.

Parameters
axis_id(number) The axis identifier whose motors should be taken out of manual mode
See also
M31:SetAxisMotorsManualModeOn() for placing motors into manual mode
M31:SupportsManualModeFeature() to check if manual mode is supported
Note
Documentation generated by AI on 2026-03-04

Called to take an axis's motors out of manual (disconnected) mode and restore normal servo control. The base implementation logs a message indicating no method is implemented and returns false. Subclasses (HiCON, M31) override this to clear the appropriate bits in the AXIS_DISABLE_BITS register for the axis's child motors.

Parameters
axis_id(number) The axis identifier whose motors should be taken out of manual mode
Returns
(boolean) False in the base implementation; subclasses return completion status
Note
Documentation generated by AI on 2026-03-04

◆ SetAxisMotorsManualModeOn()

MotionController SetAxisMotorsManualModeOn ( )

Enable manual mode for a specific axis's motors on the HiCON controller.

Base implementation to enable manual mode for a specific axis's motors.

Enable manual mode for a specific axis's motors on the M31 controller.

Retrieves the child motor IDs for the specified axis, then sets the corresponding bits in the HiCON 'AXIS_DISABLE_BITS' register to disconnect the motors from servo control. If the current register value is 0, it is first set to 95488 (the reserved mask for non-coordinate axes) before applying the motor bit. Raises an error via w.Error() if any register operation fails.

Parameters
axis_id(number) The axis identifier whose motors should be placed in manual mode
See also
HiCON:SetAxisMotorsManualModeOff() for restoring normal servo control
HiCON:SupportsManualModeFeature() to check if manual mode is supported
Note
Documentation generated by AI on 2026-03-04

Retrieves the child motor IDs for the specified axis, then sets the corresponding bits in the M31 'AXIS_DISABLE_BITS' register to disconnect the motors from servo control. If the current register value is 0, it is first set to 95488 (the reserved mask for non-coordinate axes) before applying the motor bit. Raises an error via w.Error() if any register operation fails.

Parameters
axis_id(number) The axis identifier whose motors should be placed in manual mode
See also
M31:SetAxisMotorsManualModeOff() for restoring normal servo control
M31:SupportsManualModeFeature() to check if manual mode is supported
Note
Documentation generated by AI on 2026-03-04

Called to put an axis's motors into manual (disconnected) mode so they can be moved without servo control. The base implementation logs a message indicating no method is implemented and returns false. Subclasses (HiCON, M31) override this to set the appropriate bits in the AXIS_DISABLE_BITS register for the axis's child motors.

Parameters
axis_id(number) The axis identifier whose motors should be placed in manual mode
Returns
(boolean) False in the base implementation; subclasses return completion status
Note
Documentation generated by AI on 2026-03-04

◆ SetAxisMotorsPosition()

MotionController SetAxisMotorsPosition ( position )

Set the position of an axis's motors by sending a zero-reference message to the plugin.

Retrieves the counts-per-unit for the specified motor from the machine profile and sends a MSG_SET_MOTOR_ZERO message to all plugins with the computed counts value. This effectively tells the motion controller to treat the current position as the given position value. Calls w.FunctionCompleted() on success.

Parameters
motor_id(number) The motor identifier whose position is being set
position(number) The desired position value in machine units
Warning
This sends a message to all plugin instances; ensure machine state is appropriate before calling
Note
Documentation generated by AI on 2026-03-04

◆ SetDefunct()

MotionController SetDefunct ( )

Mark this motion controller object as defunct or restore it to normal operation.

Sets the internal 'defunct' flag to the provided value. A defunct controller is a valid Lua object but will silently skip most operations. This is used when the underlying plugin is detected to be unavailable or has encountered a fatal error.

Parameters
new_value(boolean) True to mark the controller as defunct, false to restore normal operation
See also
MotionController:IsDefunct() to query the defunct state
Note
Documentation generated by AI on 2026-03-04

◆ SetManualModeOff()

MotionController SetManualModeOff ( )

No-op implementation of manual mode off for the M31 motion controller.

Disable drive enable to transition the controller into manual mode.

Does nothing. The M31 manual mode is managed per-axis via SetAxisMotorsManualModeOff() rather than at the controller level.

See also
M31:SetAxisMotorsManualModeOff() for per-axis manual mode control
MotionController:SetManualModeOff() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Called as part of the manual mode entry sequence. Disables the drive enable signal so servo drives are no longer actively controlling motors, allowing manual intervention. Raises an error via w.Error() if the SetDriveEnable call fails.

Warning
This will disable drive control for all axes on the instance
See also
MotionController:SetManualModeOn() to re-enable drive control
Note
Documentation generated by AI on 2026-03-04

◆ SetManualModeOn()

MotionController SetManualModeOn ( )

No-op implementation of manual mode on for the M31 motion controller.

Enable drive enable to transition the controller out of manual mode.

Does nothing. The M31 manual mode is managed per-axis via SetAxisMotorsManualModeOn() rather than at the controller level.

See also
M31:SetAxisMotorsManualModeOn() for per-axis manual mode control
MotionController:SetManualModeOn() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Called as part of the manual mode exit sequence. Re-enables the drive enable signal so servo drives resume active motor control after a manual mode session. Raises an error via w.Error() if the SetDriveEnable call fails.

Warning
Ensure machine state is safe before calling to avoid unexpected motion
See also
MotionController:SetManualModeOff() to disable drive control
Note
Documentation generated by AI on 2026-03-04

◆ summary()

fn_table summary ( obj ,
mc_obj  )

Provide the executive summary status string for the OpStatus dialog.

Reads and returns the current string value of the 'OpStat_Summary' RapidPath register, which contains the high-level summary description of the plugin's current operational state. Used by the OpStatus dialog as the primary status message shown to the operator.

Parameters
obj(table) The OpStatus object
mc_obj(table) The RapidPath motion controller object
Returns
(string) The current summary status string from the RapidPath plugin
Note
Documentation generated by AI on 2026-03-04

◆ SupportsManualModeFeature()

MotionController SupportsManualModeFeature ( )

Report whether the HiCON motion controller supports the manual mode feature.

Report whether this motion controller supports the manual mode feature.

Report whether the RapidPath motion controller supports the manual mode feature.

Report whether the TrioMotion motion controller supports the manual mode feature.

Report whether the DSPMC motion controller supports the manual mode feature.

Report whether the M31 motion controller supports the manual mode feature.

Returns true unconditionally, indicating that HiCON supports the ability to selectively disconnect individual axis motors from servo control via the AXIS_DISABLE_BITS register.

Returns
(boolean) Always true for HiCON
See also
MotionController:SupportsManualModeFeature() for the base (false) implementation
HiCON:SetAxisMotorsManualModeOn() for the per-axis manual mode interface
Note
Documentation generated by AI on 2026-03-04

Returns true unconditionally, indicating that M31 supports the ability to selectively disconnect individual axis motors from servo control via the AXIS_DISABLE_BITS register.

Returns
(boolean) Always true for M31
See also
MotionController:SupportsManualModeFeature() for the base (false) implementation
M31:SetAxisMotorsManualModeOn() for the per-axis manual mode interface
Note
Documentation generated by AI on 2026-03-04

Returns true unconditionally, indicating that DSPMC supports the manual mode feature for selectively controlling axis motor drive enable state.

Returns
(boolean) Always true for DSPMC
See also
MotionController:SupportsManualModeFeature() for the base (false) implementation
Note
Documentation generated by AI on 2026-03-04

Returns false unconditionally, indicating that TrioMotion does not support the ability to selectively disconnect individual axis motors from servo control.

Returns
(boolean) Always false for TrioMotion
See also
MotionController:SupportsManualModeFeature() for the base implementation
Note
Documentation generated by AI on 2026-03-04

Returns true unconditionally, indicating that RapidPath supports the ability to selectively disconnect individual axis motors from servo control via the motor connection API (MarkSingleMotorConnection, CommitMotorConnections, etc.).

Returns
(boolean) Always true for RapidPath
See also
MotionController:SupportsManualModeFeature() for the base (false) implementation
RapidPath:MarkSingleMotorConnection() for the motor disconnection interface
Note
Documentation generated by AI on 2026-03-04

Returns false in the base implementation, indicating that manual mode (the ability to selectively disconnect individual axis motors from servo control) is not supported. Subclasses such as HiCON, M31, DSPMC, and RapidPath override this to return true when they support the feature.

Returns
(boolean) False in the base implementation; true in subclasses that support manual mode
See also
MotionController:SetManualModeOn() for enabling manual mode
MotionController:SetAxisMotorsManualModeOn() for per-axis manual mode
Note
Documentation generated by AI on 2026-03-04

◆ SyncAxisMotorPositions()

RapidPath SyncAxisMotorPositions ( )

Synchronize the motor positions for all motors on the specified axis.

Sends a 'SyncAxisMotorPositions;N' operation command to the RapidPath plugin for the given axis ID. This is used to align slave motor positions with the master motor after a manual adjustment or reconnection. The result and return code from the plugin are captured but not returned or checked.

Parameters
axis_id(number) The axis identifier whose motor positions should be synchronized
Note
Documentation generated by AI on 2026-03-04

◆ UpdateMotorMapping()

MotionController UpdateMotorMapping ( )

Send the UPDATE_SOURCE_SETTINGS command to the HiCON motion controller.

Base implementation to update motor mapping on the motion controller.

Base stub for updating motor mapping on the RapidPath motion controller.

Send the UPDATE_SOURCE_SETTINGS command to the M31 motion controller.

Clears any active command by sending an empty string to the HiCON Command register, then sends the 'UPDATE_SOURCE_SETTINGS' command to update the motor source mapping. Waits 100 milliseconds after the command to allow the firmware and plugin to synchronize. Raises an error via w.FunctionError() if either register command fails.

See also
HiCON:MotionSync() for the related motion sync operation
M31:UpdateMotorMapping() for the equivalent M31 implementation
Note
Documentation generated by AI on 2026-03-04

Clears any active command by sending an empty string to the M31 Command register, then sends the 'UPDATE_SOURCE_SETTINGS' command to update the motor source mapping. Waits 100 milliseconds after the command to allow the firmware and plugin to synchronize. Raises an error via w.FunctionError() if either register command fails.

See also
M31:MotionSync() for the related motion sync operation
HiCON:UpdateMotorMapping() for the equivalent HiCON implementation
Note
Documentation generated by AI on 2026-03-04

Returns false unconditionally, indicating that the UPDATE_SOURCE_SETTINGS operation command has not yet been implemented for RapidPath (unlike HiCON and M31 which send the command via RegSendCommand). A TODO comment marks this for future implementation in the plugin.

Returns
(boolean) Always false; the operation is not implemented
See also
HiCON:UpdateMotorMapping() for a fully implemented version
M31:UpdateMotorMapping() for a fully implemented version
Note
Documentation generated by AI on 2026-03-04

Logs a message indicating no method is implemented for the current motion controller type. Subclasses (HiCON, M31) override this to send an 'UPDATE_SOURCE_SETTINGS' command to the controller hardware and allow firmware and plugin to synchronize.

Note
Documentation generated by AI on 2026-03-04

◆ WaitForEffective()

MotionController ProfilingLib WaitForEffective ( desired_state ,
feedback  )

Wait for a profiling feedback state to reach a desired value with a 10-second timeout.

Polls the provided feedback object's check() method until the state matches the desired_state or a 10-second timeout is reached. Uses w.Sleep() to yield appropriately between screen and M-code chunk contexts. Raises an error if the timeout expires before the desired state is reached.

Parameters
desired_state(boolean) The target state to wait for (true=ON, false=OFF)
feedback(table) A StateChecker object supporting a :check() method and a .path field for error messages
Returns
(boolean) True if the desired state was reached within the timeout
Warning
This function blocks execution and will raise an error on timeout
See also
MotionController.ProfilingLib.IOStateChecker() for creating feedback objects
Note
Documentation generated by AI on 2026-03-04

◆ WaitForHomingToComplete()

MotionController WaitForHomingToComplete ( )

Wait for HiCON homing motion to complete using a timed please-wait dialog.

Base implementation for waiting until homing motion is complete.

Wait for M31 homing motion to complete using a timed please-wait dialog.

Displays a please-wait dialog (PleaseWaitType.TimeDelay) for 800 milliseconds to allow the HiCON controller to complete its homing motion sequence. Raises an error via w.Error() if the dialog is cancelled or times out.

Warning
This function blocks execution for approximately 800 milliseconds
See also
HiCON:PreHoming() for inhibit setup before homing
HiCON:PostHoming() for inhibit cleanup after homing
Note
Documentation generated by AI on 2026-03-04

Displays a please-wait dialog (PleaseWaitType.TimeDelay) for 800 milliseconds to allow the M31 controller to complete its homing motion sequence. Raises an error via w.Error() if the dialog is cancelled or times out.

Warning
This function blocks execution for approximately 800 milliseconds
See also
M31:PreHoming() for inhibit setup before homing
M31:PostHoming() for inhibit cleanup after homing
Note
Documentation generated by AI on 2026-03-04

Called during the homing sequence to wait for the controller to finish its homing motion. The base implementation logs a message indicating no method is implemented. Subclasses (HiCON, M31) override this to display a please-wait dialog with an appropriate time delay before clearing.

Note
Documentation generated by AI on 2026-03-04

◆ WriteSDO()

RapidPath WriteSDO ( index ,
subindex ,
device_spec ,
byte_count  )

◆ wxdialog_ctor()

fn_table wxdialog_ctor ( ...)

Placeholder for optional wxDialog constructor override in the OpStatus function table.

This field in the fn_table is reserved for a custom wxDialog constructor function that would override the default dialog creation behavior in the OpStatus module. It is currently commented out and not assigned, indicating default dialog construction is used.

Note
Documentation generated by AI on 2026-03-04