Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Aaron P. on February 03, 2025, 05:53:38 PM
-
What I am trying to accomplish is to click a button on my screenset in Mach4 and run a file (some-gcode.tap). I am currently running Mach3 and using the Mach4 demo for testing. I have spent all day looking through the docs, reading the forums, and trying things in the demo, but I either get "Line 0: Feature not licensed," or "Line 0: Subroutine file not found," or nothing at all.
Can anyone either point me to where I can read about this or take pity on me and show me a Lua script I can put in a button?
I've been using the "Exectute GCode.mcs" in the LuaExamples folder. I've used the O9010 file in the examples folder and a file a created with a couple lines of simple Gcode (e.g. G0 X1). For the M98 line I've tried:
M98 P9010 Q1
and:
M98 Q1 (Subroutines\\9010.tap)
-
I still can't get M98 to take anything other than an O1234 file name. I would like to figure out how that works, if somebody could tell me. For now, I've got something working with mc.mcCntlLoadGcodeFile:
local inst = mc.mcGetInstance()
local filePath = "C:\\Mach4Hobby\\Subroutines\\test.tap"
mc.mcCntlLoadGcodeFile(inst, filePath)
wx.wxMilliSleep(100) --sleeps for 0.1 seconds
mc.mcCntlCycleStart(inst)