Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: lsneon on July 21, 2020, 01:37:20 PM

Title: macro failed to compile
Post by: lsneon on July 21, 2020, 01:37:20 PM
Putting together a 3 axis gantry mainly for engraving. Mach4(demo), ESS, Gecko drives. Got motors tuned & calibrated but when I try to load any of the demo gcode files I get
"a macro failed to compile while loading"
What am I missing?
Thanks
lsneon
Title: Re: macro failed to compile
Post by: KatzYaakov on July 21, 2020, 10:38:36 PM
did you add m function by yourself? or  add any script on screen set?
if so ,then you need cheak where is bad lua syntax

Title: Re: macro failed to compile
Post by: lsneon on July 22, 2020, 10:56:01 PM
did you add m function by yourself

not knowingly.
these are the gcode samples that come with Mach4 (roadrunner, etc) or font engrave wizards and
the gcode just will not load, all I get is the compile error.
Title: Re: macro failed to compile
Post by: ElderMartin on December 09, 2020, 10:22:52 PM
The same is true for me.

I have the same control and drive hardware you do.
Title: Re: macro failed to compile
Post by: joeaverage on December 10, 2020, 02:45:42 AM
Hiu,
I doubt its the controller or drive hardware.

Mach is complaining that one piece of all the bits of code it has to compile and merge into one large runtime program is failing to compile.
That in turn prevents the runtime file from completing and Mach won't run.

Either you have a corrupted copy of Mach or more likely a corrupt screenset/GUI. Have you modified any code in the screenset?

In almost every case in the event of a compile time error the Lua compiler will do a diagnostic dump which includes the location
of the offending code. Can you post a sreenshot of the diagnostic?

Craig

Title: Re: macro failed to compile
Post by: ElderMartin on December 10, 2020, 11:46:44 AM
I have changed nothing concerning the GUI.  I'm a newbie and don't even know how.

Warp9 people did send me a profile to load, and I had to change some things for the machine to home, etc.

At the bottom of the screen it says in History:  Path "C:\Mach4Hobby\Profiles\ESS G40 VFD\Macros\" not valid.

If you tell me how to look at this diagnostic dump I will show it.  I suppose you should also tell me the quickest way to post a screenshot for this message board app. 

I apologize for my ignorance. 
Title: Re: macro failed to compile
Post by: joeaverage on December 10, 2020, 01:33:05 PM
Hi,
then I think that one or more of the macros that has been bundled with the profile is corrupt.

Try deleting the profile and then see if Mach will compile and load.

Craig
Title: Re: macro failed to compile
Post by: joeaverage on December 10, 2020, 01:39:33 PM
Hi,
a little more thought about this....

Up until about a year ago the 'flavour or dialect' of Lua used in Mach, the language used for scripting and macros,
was Lua 5.2.

Since then Mach has been modified to run Lua 5.3.

While the differences between 5.2 and 5.3 are small many program chunks written under 5.2 will not compile under
the later 5.3 compiler.

My guess is tha its not so much that you have corrupt software but that it was written and compiled with an earlier release compiler.
The same solution applies, delete the offending chunk and compile whats left over.

Craig
Title: Re: macro failed to compile
Post by: jbuehn on December 10, 2020, 02:33:00 PM
Not sure if I'm remembering correctly, but was there something on the forums a while ago about not being able to have spaces in the profile name?
Title: Re: macro failed to compile
Post by: ElderMartin on December 10, 2020, 03:35:23 PM
I copied the profile and gave it a new name without spaces and that did not fix the problem.
Title: Re: macro failed to compile
Post by: ElderMartin on December 10, 2020, 03:49:11 PM
Hi,
then I think that one or more of the macros that has been bundled with the profile is corrupt.

Try deleting the profile and then see if Mach will compile and load.

Craig
But that profile is the only one by which my machine can even be recognized. 

If I delete it I can't do a thing.
Title: Re: macro failed to compile
Post by: ElderMartin on December 10, 2020, 04:18:28 PM
**Update:

The Warp9 people told me that Mach4 will say such if there is no "Macros" folder.  I created that file under the profile and I see it recognized the roadrunner gcode.

Thank you all, for your help.  It is greatly appreciated. 
Title: Re: macro failed to compile
Post by: joeaverage on December 16, 2020, 01:33:47 PM
Hi,
good to hear you've found the solution.

Quote
If I delete it I can't do a thing.

I never imported a profile from anywhere, I just made up my own. You do not need an imported profile,
it does make life easier to start with but also requires that you comply with the assumptions and hardware arrangement
as envisaged by the supplier of the profile.....whether it suits your purpose or not.

Craig