Hi Mark,
We've been asked that before and weren't able to figure out how to find out from Mach3 when it was running a Job. If someone knows where this is documented please let us know. We found a Variable called MainPlanner->MovementDone in Mach3 that seems to do this. It seems to be false when in EStop as well as running a Job but maybe that is a good thing.
KFLOP has an internal HostStatus variable that can be set by the Host Application (Mach3 Plugin or KMotionCNC) where bit zero indicates a Job is Active. There is a Macro defined in KFLOP to test this called JOB_ACTIVE.
This new patched plugin should update the Host Status based on MainPlanner->MovementDone (being false). Download and copy it to your Mach3 directory. It will only work with KMotion Version 4.32 (latest release).
http://www.dynomotion.com/Software/P...Dynomotion.dll
Here is an example C Program to display the Job Active Status on a KFLOP LED (IO47) to demonstrate it is working:
Code:
#include "KMotionDef.h"
main()
{
for(;;)
SetStateBit(47,JOB_ACTIVE);
}
In your MPG program you can test the Status with something like:
if (JOB_ACTIVE)
// do not do any MPG moves
else
// do MPG moves
Let us know if you have any problems or questions
Regards