Hello Guest it is May 18, 2021, 05:37:17 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - hankb

Pages: 1
Hello Mach4 gurus,

I have a machine that runs a long list of sequential files (hundreds of files, with each file running for just a few minutes). In order to streamline the process of running, I would like to accomplish the following:

When Gcode file is finished running, automatically load the next Gcode file.     
(Note: My post-processor is able to insert the path for the next file as a comment in the current file.)

The test Gcode file is "C:\gcodetest\TEST.txt"
The first few lines look like this:

Code: [Select]
(Next File in Queue)

G0 X0.000000 Y0.000000 Z0.200000
M3 (start Spindle)
G0 X0.000000 Y0.000000 Z5.00000
G0 X1.179950 Y4.004260 Z0.200000

Just enough to demonstrate that the file loads and runs the machine, then test M100.

The M100 code looks like this:

Code: [Select]

function M100 ()

local inst = mc.mcGetInstance()

-- Get next file name
local NextFileParen = mc.mcCntlGetGcodeLine (inst, 1) --gets name of next Gcode file
local NextFile = string.gsub(NextFileParen, "[()]", "") --strips parentheses
wx.wxMessageBox("Next file path - "..NextFile) --for troubleshooting

--Close current file
mc.mcCntlCloseGCodeFile (inst)
wx.wxMessageBox("closed - "..CurrentFile) --for troubleshooting

--Load next file **NOT WORKING**
mc.mcCntlLoadGcodeFile (inst, NextFile)
wx.wxMessageBox("opened "..NextFile) --for troubleshooting


This macro runs through the end (including the last message box), but does not load the next file.

Does anyone know how I could get this macro running?
Thank you for your insight,

Pages: 1