PC_COMM_HALT_NEXT_LINE issue

Moderators: TomKerekes, dynomotion

Post Reply
User avatar
cnc_freak
Posts: 58
Joined: Fri Apr 20, 2018 5:36 am
Location: Greece
Contact:

PC_COMM_HALT_NEXT_LINE issue

Post by cnc_freak » Wed Feb 17, 2021 5:13 pm

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.
Attachments
B2.ngc
(6.95 KiB) Downloaded 81 times
Init3Analog.c
(22.25 KiB) Downloaded 81 times

User avatar
TomKerekes
Posts: 2676
Joined: Mon Dec 04, 2017 1:49 am

Re: PC_COMM_HALT_NEXT_LINE issue

Post by TomKerekes » Wed Feb 17, 2021 5:51 pm

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.
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
cnc_freak
Posts: 58
Joined: Fri Apr 20, 2018 5:36 am
Location: Greece
Contact:

Re: PC_COMM_HALT_NEXT_LINE issue

Post by cnc_freak » Thu Feb 18, 2021 12:08 pm

Yes that worked fine, thank you.

Post Reply