|
/* Poll for amp fault, motion done, at velocity on a particular motion supervisor */
while(meiPlatformKey(MPIWaitPOLL) <= 0)
{
returnValue = mpiMotionStatus(motion, &status, NULL);
msgCHECK(returnValue);
/*
The ...maskBitGET will return a 0 or the mask. It is simpler to look
for a not false than the mask.
*/
if(mpiEventMaskBitGET(status.eventMask, MPIEventTypeMOTION_DONE) != FALSE)
{
printf("\rMotion Done TRUE ");
}
else
{
printf("\rMotion Done FALSE");
}
if(mpiEventMaskBitGET(status.eventMask, MPIEventTypeMOTION_AT_VELOCITY) != FALSE)
{
printf(" At Velocity TRUE ");
}
else
{
printf(" At Velocity FALSE");
}
if(mpiEventMaskBitGET(status.eventMask, MPIEventTypeAMP_FAULT) != FALSE)
{
printf(" Amp Fault TRUE ");
}
else
{
printf(" Amp Fault FALSE");
}
meiPlatformSleep(100); /* Wait to keep low CPU usage */
}
|