Hi,
I figured I'd throw in an extra 2 cents worth....
Yes M codes can call other M codes - many people find that the resulting actions are not quite what they assumed. This is because there are some synchronization considerations you have to worry about (as Ray pointed out).
Also realize that since Mcodes are just files that contain mach scripts, the script language tools that you have available vary depending on the version of Mach that you are running.
With later versions of mach, the synchronization considerations can be easier - as there are more tools to help the script writer.
In particular, the 3.43.x development mach versions have programming tools which are not avail in the 3.42.40 lock down release.
To learn about these you go get the current mach programmers ref manual
http://machsupport.com/docs/Mach3_V3.x_Macro_Prog_Ref.pdfSome key things to read about are:
3.43.x supports named scripts that live on disk. Read about #expand to see where mach looks for named scripts.
For me, this effectively let me eliminate all Mcode to Mcode calling. I only use Mcodes as a link from Gcode to get a script invoked.
Some things to read about for more info:
RunScript() - this has the nice property that it does not return until the called script is finished.
StartperiodicScript() and StopPeriodicScript() - these calls allow you to start and stop periodic scripts, and allow you to set the run period - this can be much more flexible than the older MacroPump which has only a fixed period.
Dave