Page 1 of 1

PC_COMM_HALT_NEXT_LINE issue

Posted: Wed Feb 17, 2021 5:13 pm
by cnc_freak
Hello.
In a drill machine i'm retrofiting i need to move the drill head (axis X) + direction until a bit is reset, in order to find the beginning of the part to be drilled.
I but in the begining of gcode a M100 command, which should do this operation.
I programed the M100 function "in KmotionCNC" to set a I/O bit the bit 60.
In the c init program endless loop i check this bit in order to execute the M100 function.
This M100 function should DoPC(PC_COMM_HALT_NEXT_LINE) in order to pause the gcode until the part is found and then resume the execution of the rest of the gcode. My problem is that the gcode does not halt to the next line, but continues. When i use the DoPC(PC_COMM_HALT) then it works fine, but i need to press again the continue button in order to resume the gcode. Why do this happen? Please advice.
Attached is the init c program and the gcode.

Re: PC_COMM_HALT_NEXT_LINE issue

Posted: Wed Feb 17, 2021 5:51 pm
by TomKerekes
Hi,

I think that Halting/Executing approach will have many timing issues.

Why not have the M100 execute a C Program to Jog until the bit changes, stop, then terminate. Program KMotionCNC to execute/wait/sync. Then in the GCode after the M100 do the G92X360.

Re: PC_COMM_HALT_NEXT_LINE issue

Posted: Thu Feb 18, 2021 12:08 pm
by cnc_freak
Yes that worked fine, thank you.