Hello, I'm trying to develop a plugin and I need to move the Z axis to 270mm via the python script and wait until the position is reached. So I use the commands :
self._printer.commands("G90")
self._printer.commands("G0 Z270")
But how can I do to wait that the position is reached before continuing the script of the plugin?
thanks for the help,
lImprimeur
You can send an M400 command after the G0 command, which will make sure all moves are completed before continuing. If you need to know on the plugin side when exactly that happens on the printer side, due to printer buffers and such, would require host_action_commands to be supported and enabled by your printer and then you could use M118 echo/action commands and octoprint.comm.protocol.action to basically have the printer tell OctoPrint/plugin over the serial commands that it has happened, potentially a combination of the two.