Hi,
GcodeExecuteWait works to ensure that one block of Gcode is executed BEFORE a second block is queued up.......but this is within one chunk, namely Machs core.
It does not work to separate the GUI chunk from the Main chunk.
As I posted earlier Lua co-routines are cooperative not preemptive. There is no way, to my knowledge, to force one chunk to yield to the other.
gcodeexecutewait(g04 p1.0) commands to force a machine pause condition.
I can see why you might think this is a good idea, but it won't work. 'g04p1.0' is still a Gcode instruction. Machs Main chunk will interpret this instruction and execute it, it does not mean
that the Main chunk becomes idle....after all it
is doing something, namely waiting for the current instruction to complete.
Craig