Page 1 of 1

How to make CNC light program (Indicator for Feed hold and Cycle start, ALARM)

Posted: Wed Jan 22, 2020 11:57 am
by AmitKumar171
Hi tom ,

I want to make a CNC light indicator (Stack light) program which indicates different program states of the machine.

RED: Failure conditions such as an emergency stop or machine fault or alarm
YELLOW: and FEED hold condition Warnings such as over-temperature or over-pressure conditions (G code not running) , G code completed.
GREEN: Normal machine or process operation (G code running)
stack-light.jpg
How to make that C program that monitor all above. ? and how to process with that ?

and how to integrate with KFLOP+KANALOG+KONNECT .

Waiting for your kind reply.

Re: How to make CNC light program (Indicator for Feed hold and Cycle start, ALARM)

Posted: Thu Jan 23, 2020 5:07 pm
by TomKerekes
Hi Amit,
RED: Failure conditions such as an emergency stop or machine fault or alarm
For this you might test any EStop you have or whether any of your axes are disabled (chx->Enable)

YELLOW: and FEED hold condition Warnings such as over-temperature or over-pressure conditions (G code not running) , G code completed.
You should know what sensors you have on your system. JOB_ACTIVE being FALSE would indicate GCode not running

CS0_StoppingState != 0 would indicate a feedhold in progress.

GREEN: Normal machine or process operation (G code running)
JOB_ACTIVE being TRUE would indicate GCode running.

Re: How to make CNC light program (Indicator for Feed hold and Cycle start, ALARM)

Posted: Mon Jan 27, 2020 5:50 am
by AmitKumar171
Hi tom ,

Thanks for the reply,

Is there any example of C program so i can get some programming idea too. ??

Waiting for your kind reply.

Re: How to make CNC light program (Indicator for Feed hold and Cycle start, ALARM)

Posted: Mon Jan 27, 2020 5:11 pm
by TomKerekes
Hi Amit,

You might try something like:

Code: Select all

include "KMotionDef.h"

#define RED 46
#define YELLOW 47
#define GREEN 48

void main()
{
	for (;;)					// forever loop
	{
		if (CS0_StoppingState != 0)	// Feed hold ?
		{
			SetBit(YELLOW);
			ClearBit(GREEN);
			ClearBit(RED);
		}
		else if (JOB_ACTIVE)	// Job Active ?
		{
			SetBit(GREEN);
			ClearBit(YELLOW);
			ClearBit(RED);
		}
		else					// otherwise
		{
			SetBit(RED);
			ClearBit(YELLOW);
			ClearBit(GREEN);
		}
	}
}