Handle the case where motion control is not enabled on the panel. This is regarded as a hardware fault for all DMC2280 motors.
r1563 | dcl | 2007-03-01 09:09:32 +1100 (Thu, 01 Mar 2007) | 2 lines
This commit is contained in:
@@ -118,6 +118,9 @@ typedef struct __MoDriv {
|
|||||||
pNWTimer motor_timer;
|
pNWTimer motor_timer;
|
||||||
int debug;
|
int debug;
|
||||||
} DMC2280Driv, *pDMC2280Driv;
|
} DMC2280Driv, *pDMC2280Driv;
|
||||||
|
|
||||||
|
int DMC2280MotionControl = 1; /* defaults to enabled */
|
||||||
|
|
||||||
#define AIRPADS_DOWN 0
|
#define AIRPADS_DOWN 0
|
||||||
#define AIRPADS_RAISE 1
|
#define AIRPADS_RAISE 1
|
||||||
#define AIRPADS_UP 2
|
#define AIRPADS_UP 2
|
||||||
@@ -138,6 +141,7 @@ typedef struct __MoDriv {
|
|||||||
#define IMPOSSIBLE_LIM_SW -14
|
#define IMPOSSIBLE_LIM_SW -14
|
||||||
#define BGFAIL -15 // NOT SET
|
#define BGFAIL -15 // NOT SET
|
||||||
#define BLOCKED -16
|
#define BLOCKED -16
|
||||||
|
#define MOTIONCONTROL -17
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
#define STATUSMOVING 128 /* Motor is moving */
|
#define STATUSMOVING 128 /* Motor is moving */
|
||||||
#define STATUSERRORLIMIT 64 /* Number of errorss exceed limit */
|
#define STATUSERRORLIMIT 64 /* Number of errorss exceed limit */
|
||||||
@@ -599,6 +603,12 @@ static int DMC2280Run(void *pData,float fValue){
|
|||||||
self = (pDMC2280Driv)pData;
|
self = (pDMC2280Driv)pData;
|
||||||
assert(self != NULL);
|
assert(self != NULL);
|
||||||
|
|
||||||
|
/* If Motion Control is off, report HWFault */
|
||||||
|
if (!DMC2280MotionControl) {
|
||||||
|
self->errorCode = MOTIONCONTROL;
|
||||||
|
return HWFault;
|
||||||
|
}
|
||||||
|
|
||||||
if (self->motor_timer)
|
if (self->motor_timer)
|
||||||
NetWatchRemoveTimer(self->motor_timer);
|
NetWatchRemoveTimer(self->motor_timer);
|
||||||
self->motor_timer = NULL;
|
self->motor_timer = NULL;
|
||||||
@@ -812,6 +822,11 @@ static int DMC2280Status(void *pData){
|
|||||||
}
|
}
|
||||||
if (moving) {
|
if (moving) {
|
||||||
int iRet;
|
int iRet;
|
||||||
|
/* If Motion Control is off, report HWFault */
|
||||||
|
if (!DMC2280MotionControl) {
|
||||||
|
self->errorCode = MOTIONCONTROL;
|
||||||
|
return HWFault;
|
||||||
|
}
|
||||||
/* If pos hasn't changed since last
|
/* If pos hasn't changed since last
|
||||||
* check then stop and scream */
|
* check then stop and scream */
|
||||||
#if 0
|
#if 0
|
||||||
@@ -1004,6 +1019,9 @@ static void DMC2280Error(void *pData, int *iCode, char *error, int errLen){
|
|||||||
case BLOCKED:
|
case BLOCKED:
|
||||||
strncpy(error,"STOPPING MOTOR, MOTION SEEMS TO BE BLOCKED", (size_t)errLen);
|
strncpy(error,"STOPPING MOTOR, MOTION SEEMS TO BE BLOCKED", (size_t)errLen);
|
||||||
break;
|
break;
|
||||||
|
case MOTIONCONTROL:
|
||||||
|
strncpy(error,"MOTION CONTROL SEEMS TO BE DISABLED", (size_t)errLen);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* FIXME What's the default */
|
/* FIXME What's the default */
|
||||||
break;
|
break;
|
||||||
@@ -1034,6 +1052,7 @@ static int DMC2280Fix(void *pData, int iCode,/*@unused@*/ float fValue){
|
|||||||
//case TIMEOUT:
|
//case TIMEOUT:
|
||||||
case BADPAR:
|
case BADPAR:
|
||||||
case BLOCKED:
|
case BLOCKED:
|
||||||
|
case MOTIONCONTROL:
|
||||||
return MOTFAIL;
|
return MOTFAIL;
|
||||||
case POSFAULT:
|
case POSFAULT:
|
||||||
case BADSEND:
|
case BADSEND:
|
||||||
|
|||||||
Reference in New Issue
Block a user