Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Gerber Baby on April 23, 2015, 09:42:37 PM
-
Is there an easier way to see if am in G90, G0, etc without calling
mc.mcCtrlGetModalGroup();
and then doing clumsy Lua string manipulation to find if they are in the returned string?
I just really want to be able to know if I am in certain G-code modes so I can set it back later after zeroing my tools.
-
Hey guys, answered my own question. These things are stored as # variables. I found the Mach 4 Scripting Manual today in the manuals section where the Mach 4 is downloaded , which seems to be new unless I missed it previously.
2134 stores last feed rate
4001 stores G00 or G01 and results as 00 or 10
4003 stores G90 or G91 and results as 910 or 900
How to set variables (excerpt):
local CurFeed = mc.mcCntlGetPoundVar(inst, 2134)
local CurFeedMode = mc.mcCntlGetPoundVar(inst, 4001)
local CurAbsMode = mc.mcCntlGetPoundVar(inst, 4003)
-
Hey guys, answered my own question. These things are stored as # variables. I found the Mach 4 Scripting Manual today in the manuals section where the Mach 4 is downloaded , which seems to be new unless I missed it previously.
2134 stores last feed rate
4001 stores G00 or G01 and results as 00 or 10
4003 stores G90 or G91 and results as 910 or 900
How to set variables (excerpt):
local CurFeed = mc.mcCntlGetPoundVar(inst, 2134)
local CurFeedMode = mc.mcCntlGetPoundVar(inst, 4001)
local CurAbsMode = mc.mcCntlGetPoundVar(inst, 4003)
Thanks for all your input to this forum Gerber Baby. I can't find "Mach 4 Scripting Manual" in the Docs folder of the Mach4Hobby install (2336) and it's not where Mach 4 is downloaded. I don't see a "manuals section" either. Appreciate any help. Thanks, Tony
-
Left side of the screen under 'Help and Learning'.
Didn't know it was there until Gerber Baby's post. Thanks!
Peter
-
Thanks, I didn't see that before either.
Tony
-
Thanks guys. Happy to be here. Let me know if you see a list of the pound vars, b/c I'm kind of wandering around in the dark on that one. This thread has the best list I've seen so far: http://www.machsupport.com/forum/index.php/topic,27264.20.html (http://www.machsupport.com/forum/index.php/topic,27264.20.html)
Also, here's the link to the LUA Scripting Manual if anybody wants it:
http://www.machsupport.com/help-learning/product-manuals/ (http://www.machsupport.com/help-learning/product-manuals/)
-
A lot of what you boys require is in M4 tool box