1
Mach4 General Discussion / Mcode Macro works in program but not MDI?
« on: March 26, 2020, 04:57:11 PM »
I have a macro M100 that I use to control a grinding cycle. It checks the user input and outfeeds a grinding wheel until the total grind amount is reached. If I make a program:
The macro program runs fine. But if I just call M100 from MDI, the macro starts but never outfeeds the wheel. The wheel outfeed is done in the plc loop like this:
The macro and plc loop both read from and write to Gregister values for this cycle to work. This used to work properly in a much older version of Mach4. Currently running version 4300
Can anyone give me an idea as to what would cause differing behavior like this? I would expect M100 to do the exact same thing running in MDI or as a Gcode program?
Code: [Select]
M100
M30
The macro program runs fine. But if I just call M100 from MDI, the macro starts but never outfeeds the wheel. The wheel outfeed is done in the plc loop like this:
Code: [Select]
local g_code = ""
g_code = g_code ..string.format("G0 G91 A%.4f\n",cut_amount)
mc.mcCntlGcodeExecute(inst, g_code)
The macro and plc loop both read from and write to Gregister values for this cycle to work. This used to work properly in a much older version of Mach4. Currently running version 4300
Can anyone give me an idea as to what would cause differing behavior like this? I would expect M100 to do the exact same thing running in MDI or as a Gcode program?