Hi,
when using mc.mcCntlGcodeExecute***() type statements you have seen that the machine needs to be in idle state
before it can accept such a command.
As you know the GUI and Machs Gcode interpreter are in different chunks. Thus a command such as mcCntlGcodeExecute()
would fail if the GUI chunk is currently running. If however the GUI chunk never runs then the screen is frozen, live
updates to DRO's the tool path display or anything else is possible. In the normal operation of Mach it is necessary for both
chunks to run and yet they cannot run simultaneously.
At other times Machs motion planner is under control of another instruction set, an MDI command string for example.
Thus any instruction like mcCntlGcodeExecute() would have to wait until that string were concluded before the motion planner
can be engaged.
It might in some circumstances be possible to add a wait period within your code so that a particular command could
be progressed where it had been unable to be progressed a few milliseconds before.
When I suggested testing the return codes it was more about alerting you to the clash rather than solving it.
If you are aware that a clash is occurring then you have the opportunity to study the circumstances where it occurs
and a subtle change of approach might avoid the clash altogether.
There is a list of all machine states in:
https://www.machsupport.com/forum/index.php?topic=40051.0Craig