951
Mach4 General Discussion / Re: Needing help with screens
« on: December 10, 2014, 01:49:38 PM »
In a M code script, one that will be run from a G code file, it is best to use mc.mcCntlExecuteGcode() mc.mcCntlGcodeExecute() or mc.mcCntlExecuteGcodeWait() instead of mc.mcCntlMdiExecute(). MdiExecute will only run if the machine is in the idle state.
mc.mcCntlExecuteGcode() mc.mcCntlGcodeExecute() will not wait for the G code to complete. It is there so that button scripts can fire off code like the Goto Zero button uses. You don't really want to wait on G code in a button script as it will freeze the GUI until it completes. The act of executing the G code changes the machine state and you can use the state to lock out buttons to keep things from happening while the G code is running to completion. mc.mcCntlExecuteGcode() mc.mcCntlGcodeExecute() will call MdiExecute() if the machine is in the idles state. This is a good choice to use in button scripts.
mc.mcCntlExecuteGcodeWait() does as it implies. It will actually run G code while a file is running, so it is the best thing to use for M code scripts. Again, mc.mcCntlExecuteGcodeWait() will call MdiExecute() if the machine is in the idles state. Not so good for button scripts.
Steve
mc.mcCntlExecuteGcodeWait() does as it implies. It will actually run G code while a file is running, so it is the best thing to use for M code scripts. Again, mc.mcCntlExecuteGcodeWait() will call MdiExecute() if the machine is in the idles state. Not so good for button scripts.
Steve