Hello everyone,
I use custom M code to collect data during my CNC machining, and I find it a very powerful feature in the Kogna motion controller. Custom M codes allow anything that may be programmed in C to be invoked, making them crucial for complex machining tasks. However, after testing with two computers using my Kogna updated to version 5.3.7, I encounter issues such as “Error Locating TCC67.exe Compiler,” “Error Compiling and Loading KMotion Program,” and “can’t open file.” This error disrupted KMotionCNC and I cannot finish a single job with custom M codes. After researching this forum, I realize that I am not alone and found related threads like “TCC compiler issues” by SamMarrocco (2020) and this thread (2022). Unfortunately, the error could not be reproduced by Tom, our moderator.
Inspired by gui_marchioro’s procedure, I tested the following and found this error highly reproducible with heavy use of custom M codes. The steps are:
1) Use “InitStepDir3Axis.c” provided by Dynomotion as the initialization file

2) Set up M100 using “print.c” provided by Dynomotion.

3) Ran a gcode ("M100 test.nc") with 500 lines of M100.
https://www.dropbox.com/scl/fi/uqlqf3my ... 2hs0n&dl=1
Instead of a nondeterministic error, I consistently encounter the error after 27 seconds of running the gcode ("M100 test.nc"), the errors appear in the following order:
Furthermore, I tested the following parameters and found NO impact on avoiding the error:
a. Different initialization files.
b. Different threads assigned to run M100 (tried 2, 3, 7).
c. Different VAR values (tried 0, 1, 999).
d. The content of the M100 file; even an empty file like the following triggers the error:
Code: Select all
#include "KMotionDef.h"
main()
{
}
The only parameter that matters, as mentioned by gui_marchioro’s previously, is using the output file of “print.c” instead of “print.c.” Instead of being nondeterministic, every single time the “"M100 test.nc"” can be completed just once by using the output file, but pressing the run button again the errors appear in the following order:
My requests:
Hi Tom, if the error is still not reproducible on your end, could you kindly provide a workaround for those of us who use lots of custom M codes?
Additionally, I would greatly appreciate it if other Kogna users could try the above test to see if the file loading error is reproducible on your systems. If you are not comfortable using the "M100 test.nc" file I uploaded, it simply contains 500 lines of M100 followed by M9 and M30.
Many thanks to everyone!!!