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

Moderators: TomKerekes, dynomotion

Post Reply
AmitKumar171
Posts: 134
Joined: Tue Feb 20, 2018 7:35 am
Location: India

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

Post by AmitKumar171 » Thu Aug 20, 2020 9:55 am

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.
Thank You

AMIT KUMAR

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

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

Post by TomKerekes » Thu Aug 20, 2020 4:47 pm

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

Tom Kerekes
Dynomotion, Inc.

AmitKumar171
Posts: 134
Joined: Tue Feb 20, 2018 7:35 am
Location: India

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

Post by AmitKumar171 » Tue Aug 25, 2020 6:47 am

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.
Thank You

AMIT KUMAR

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

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

Post by TomKerekes » Tue Aug 25, 2020 3:53 pm

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);
		}
Regards,

Tom Kerekes
Dynomotion, Inc.

AmitKumar171
Posts: 134
Joined: Tue Feb 20, 2018 7:35 am
Location: India

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

Post by AmitKumar171 » Wed Aug 26, 2020 12:12 pm

Hi tom,

Thanks for your reply.
Thank You

AMIT KUMAR

Post Reply