Page 1 of 1

How to restart the nc program in case of power cut in kmotioncnc

Posted: Thu Aug 20, 2020 9:55 am
by AmitKumar171
Hi tom.

I am using Kmotioncnc for machining parts.

When there is a power cut, The program stops there and when all drives and motors are off, Is there any way to save the running g code line or position so i can start the kmotioncnc again which line it stopped due to power cut.

Is there any way to detect power cut using IO and stop the program, save the running g code line ?????

Waiting for kind reply.

Re: How to restart the nc program in case of power cut in kmotioncnc

Posted: Thu Aug 20, 2020 4:47 pm
by TomKerekes
Hi Amit,

If power is really lost then it is not possible to do anything. Do you have an uninterruptible power source to give some warning?

Currently the the last GCode line executed is not accessible or written to any file. I suppose KMotionCNC could be modified to add the last Halted Line to the RunLog. It currently only has the Filename, Time, and Job Time. This wouldn't help if the GCode has Subroutines.

Re: How to restart the nc program in case of power cut in kmotioncnc

Posted: Tue Aug 25, 2020 6:47 am
by AmitKumar171
Hi tom,

Thanks for your reply.

As you said i have uninterruptible power source that will give I/O as out put either high or low when the power cut happens.

Can we do something like that program will pause and then stop when the power source gives warnings to Kflop i/o. ?

Waiting for your kind reply.

Re: How to restart the nc program in case of power cut in kmotioncnc

Posted: Tue Aug 25, 2020 3:53 pm
by TomKerekes
Hi Amit,

I would think that would be exactly like having an external Halt button. See this part of the ExternalButtons.c exmple:

Code: Select all

		// Handle HALT
		result = Debounce(ReadBit(HALTBIT),&hcount,&hlast,&hlastsolid);
		if  (result == 1)
		{
			DoPC(PC_COMM_HALT);
		}

Re: How to restart the nc program in case of power cut in kmotioncnc

Posted: Wed Aug 26, 2020 12:12 pm
by AmitKumar171
Hi tom,

Thanks for your reply.