Hi,
so you want the machine to go to Z20 before you start.....but where is Z20?......if your machine is referenced already then yes Z20
makes sense but if its not referenced then G0 Z20 could be anywhere. I can't quite see the logic of what you are trying to achieve.
That does not change the fact that you have coded incorrectly.
the Line:
mc.mcCntlGcodeExecute(inst, 'G00 Z20')
starts the move, but while the move is still executing the function returns. You need to use:
mc.mcCntlGcodeExecuteWait(inst,'g0z20')
As a side matter Machs Gcode interpreter converts all Gcode to lowercase, strips out leading zeros and whitespace. Thus 'G00 Z20'
becomes 'g0z20' It should, in theory, mean the same thing, but there are occasions when the translation does not work and you will
struggle to identify the fault. My suggestion is to write the Gcode exactly as the interpreter requires rather than rely on its translation
of what you have written.
Craig