Monday, 27 March 2023
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 is very simple.
How they work
When PathPilot starts 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. Once a plug-in has been loaded, it's up to it to decide how it interacts with the rest of the LinuxCNC system and the Linux operating system itself.
This site was last updated 27/03/23