Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: dhelf on August 08, 2019, 06:57:21 PM

Title: Macro from MDI
Post by: dhelf on August 08, 2019, 06:57:21 PM
I have tried to search the forum so as not to ask redundant questions, but did not find much. How can a macro work perfect in the editor, but not finish from the MDI? It is saved as an mcs extension. At the moment this is on a demo, does that have something to do with it?
Thanks
Title: Re: Macro from MDI
Post by: smurph on August 14, 2019, 12:49:12 AM
It is probably a case issue.  The macron filename needs to be lower case.  We will use m103 for the macro name for this example.  So "m103.mcs" (correct) vs. M101.mcs (incorrect).  Then, inside the file, there should be a function called m103().  This function should also be lower case.  Finally, the the stub code InEditor needs to call the lower case m103() function.

In summary, just lower case the filename and function name.  If either is upper case it will run in the editor but not in MDI or a G code file.  (Sound familiar?)  Oh, and the function name and filename had better match.  For example, you don't want a filename of m103.mcs and have a function inside it named m102(). 

Steve