Hi Steve,
How is your Console connected? To KFLOP?
For M codes if there are outputs for Spindle On/off Coolant On/off you might just read those directly and "echo" those to other Outputs?
ie:
SetStateBit(XXX,ReadBit(YYY));
You would probably need a service loop running forever that would test the various conditions and then set your indicators.
// Global Host Status extern int HostStatus
// As host is requesting Global Status from KFLOP it can also optionally
// specify its status as a 32 bit field. Bits can indicate its state and
// modes such as whether a a Job is actively running so KFLOP should inhibit
// mpg jogging
#define HOST_JOB_ACTIVE_BIT 1 // bit0 indicates Host Job is Actively running
KMotionCNC sets a "HostStatus" word in KFLOP where bit 0 indicates whether a
program is running. Here from the PC-DSP.h file
// Global Host Status extern int HostStatus
// As host is requesting Global Status from KFLOP it can also optionally
// specify its status as a 32 bit field. Bits can indicate its state and
// modes such as whether a a Job is actively running so KFLOP should inhibit
// mpg jogging
#define HOST_JOB_ACTIVE_BIT 1 // bit0 indicates Host Job is Actively running
So something like:
SetStateBit(XXX,HostStatus & HOST_JOB_ACTIVE_BIT);
Feedhold state can be determined from this variable being non-zero (from KMotionDef.h)
extern int CS0_StoppingState; // emergency stop in progress, 0 = not stopping, 1=stopping coord motion, 2=stopping indep
ie
if (CS0_StoppingState > 0)
SetBit(FEEDHOLDINDICATORBIT);
else
ClearBit(FEEDHOLDINDICATORBIT);
HTH
Regards
TK
| Group: DynoMotion |
Message: 9206 |
From: ricochetproducts |
Date: 2/17/2014 |
| Subject: Re: Program Status Indicators |
Hi Tom, My console indicators are connected to Kflop via Konnect I/O Thanks for you quick reply! Steve
|
|