PathPilot Plugins

Thursday, 20 October 2022

Home
Up
Plugin controller
Probe Guard
Turn off outputs
Traffic lights

 

PathPilot plugins

These plugins are a way of adding functionality to PathPilot without requiring any modifications to the existing PathPilot code.  They don't have any associated user interface, but they can monitor the machine's activity and react to it.  They can communicate with other devices via USB, ethernet and possibly Bluetooth as well, so can be used to synchronise external equipment.  It's also important that they're very simple to install and that that installation survives PathPilot updates and doesn't have to be done again.

I already have a plugin to make sure you can't turn on the spindle when a probe or Haimer is loaded, one to make sure all outputs on a USB I/O board get turned off at the end of a program run and one to implement a traffic light style status display using a USB I/O board.  I have a number of other ideas I'd like to implement, so the plugin architecture is important to allow people to choose which functions they want and to install/remove them whenever required.

Installation

Installation is very simple.

  1. Open PathPilot, go to the File tab.
  2. Go to the home folder if you're not already there and create a folder named python.  Note that python is in lower case.
  3. Use a USB stick or a network connection to copy the plugin controller ui_hooks.py and any plugin module you wish into the python folder.
  4. Restart PathPilot.
  5. Check the status page to see that each of the modules started up successfully.

How they work

When PathPilot stats up, it checks in the Linux folder /home/operator/gcode/python to see if there's a file named ui_hooks.py.  If the file exists, PathPilot loads it and attempts to create an object of type class ui_hooks().

ui_hooks then searches the same folder for any files named *_plugin.py and creates an object of type class UserPlugin from the code in each plugin it finds.  The code in each plugin is provided with objects to access the LinuxCNC core.  There's a linuxcnc.command to send commands to the machine and a linuxcnc.stat to determine current machine status.  Plugins can also check the PathPilot version number and can write messages to the status screen.

What's available

ui_hooks.py The plugin controller.  You must have this at least to make the other plugins work.
ProbeGuard_plugin.py Make sure the spindle cannot start while a probe or Haimer is loaded
TurnOffOutputs_plugin.py Turn off all USB I/O outputs when a program ends, even if by e-stop
TrafficLight_plugin.py Implement traffic light display using a USB I/O board

 

Home | Up | Plugin controller | Probe Guard | Turn off outputs | Traffic lights

 

This site was last updated 20/10/22