I'm having an issue with KMotionCNC running code past the second tool change. The first tool change is performed and KMotionCNC continues to run the gcode and then the second tool change is performed and a gcode error comes up. The gcode error is caused by the Y Axis disabling. Looking at the console it shows that the Y-Axis (Chan 1) was disabled due to exceeding max follow error however the tool change routine completes without an issue ("Tool Change Complete"). Z Axis (Chan 2) is also disable but the console does not show that it exceeded max follow error. X Axis (Chan 0) is still enabled.
I tried to play around with the gcode to see if I can get a different result. Anytime a dwell or motion command is placed immediately after the tool change that seems to trigger the max follow error. If I place just G00 after the tool change it does not trigger it until a G4 or G00 X__ Y__ is encountered. I know this because the Spindle turns on when the "S4000 M3" command is placed after "G00 G54" but does not turn on when placed after "G00 X0.0 Y-0.0098". What's also strange is that the motion command will be an XY motion but the Y and Z axes are the ones that get disabled which hints at the tool change program being the problem as the tool change routine only moves the Y and Z axes.
Running this code in single step mode does not generate any errors and works as it should.
If I remove the second T code on line N144 then it runs without generating an error.
I also tried to run the gcode with a dummy tool change program where it simply prints a string to the console. That did not generate any errors and the gcode ran fine. So it seems as if there is either a problem in my ToolChange.c program or there is a bug in KMotionCNC. It's just hard to tell which one because the tool change program runs fine and completes and all axes are still enabled upon completion.
Another observation I made is on the kmotion Axis window. Both axes 1 and 2 (Y and Z) are being commanded to move but no Z move command is given in gcode.
I have tried this in KMotionCNC version 4.32 as well as 4.33k, both with the same results.
I have included a video of the tool change, some screen shots, tool change program as well as the gcode program. Also the M6 code is setup as "Execute/Wait" Thread: 2 Var: 9