I wrote a plugin that adds a custom M command to drive the AUX and flood/mist/spindle pins such that when you send M101 Q1 it would turn on a binary representation of that number on the pins, allowing for 64 different pin states (since we're not using the cool or spindle functions for anything else in my use-case). My issue is that when I send the Gcode via websocket to the board, the m code command, while very clearly being after all movement, is executed before the machine stops moving. I'm not sure with the documentation, but is there a certain step I'm missing in my plugin to handle waiting for the movement of the axis to complete before execution?
This is the current code for the m-code handling of my plugin:
Is there a place here where I can basically enqueue the execution of the m command until its order in the actual execution of the gcode? This is a snippet of the end of the gcode where I'm issuing the M102 command which turns off all pins. The pins are actually being triggered time-wise at about the beginning of this section of gcode, rather than nearly 5 seconds later, after the G0 X0 Y0 Z0 command is complete.
I wrote a plugin that adds a custom M command to drive the AUX and flood/mist/spindle pins such that when you send
M101 Q1
it would turn on a binary representation of that number on the pins, allowing for 64 different pin states (since we're not using the cool or spindle functions for anything else in my use-case). My issue is that when I send the Gcode via websocket to the board, the m code command, while very clearly being after all movement, is executed before the machine stops moving. I'm not sure with the documentation, but is there a certain step I'm missing in my plugin to handle waiting for the movement of the axis to complete before execution?This is the current code for the m-code handling of my plugin:
Is there a place here where I can basically enqueue the execution of the m command until its order in the actual execution of the gcode? This is a snippet of the end of the gcode where I'm issuing the
M102
command which turns off all pins. The pins are actually being triggered time-wise at about the beginning of this section of gcode, rather than nearly 5 seconds later, after theG0 X0 Y0 Z0
command is complete.