I created a new m code, m500 and put it in the folder 'C:\Mach4Hobby\Profiles\AXYZ\Macros'.
The contents of the file are:
function m500()
wx.wxMessageBox("Works")
end
if (mc.mcInEditor() == 1) then
m500()
end
I'm running the profile in AXYZ and have confirmed this.
When I type 'M500' in the MDI window, or put it in a gcode file it does not execute. It just sits on the line and the cycle time counter goes up. I don't get any errors, it doesn't do anything.
I tried making a simple gcode file that looked like:
X0 Y0
m500
X1 Y1
The machine moves to 0,0 then just sits on the m500 line.
I tried calling the command from a button and it works fine
I stepped through the function and the message box pops up correctly.
What am I doing wrong?