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

Moderators: TomKerekes, dynomotion

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

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

Post by AmitKumar171 » Wed Jan 22, 2020 11:57 am

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

AMIT KUMAR

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

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

Post by TomKerekes » Thu Jan 23, 2020 5:07 pm

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

Tom Kerekes
Dynomotion, Inc.

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

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

Post by AmitKumar171 » Mon Jan 27, 2020 5:50 am

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

AMIT KUMAR

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

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

Post by TomKerekes » Mon Jan 27, 2020 5:11 pm

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

Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply