Eliminate erroneous "Motor motion timeout ERROR".

This commit is contained in:
Ron Sluiter
2004-02-03 20:09:00 +00:00
parent be44621cfd
commit 3eee8b4b5d
2 changed files with 38 additions and 17 deletions
+22 -11
View File
@@ -2,9 +2,9 @@
FILENAME... drvOms.cc
USAGE... Driver level support for OMS models VME8, VME44 and VS4.
Version: $Revision: 1.14 $
Version: $Revision: 1.15 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2004-01-22 22:18:49 $
Last Modified: $Date: 2004-02-03 20:09:00 $
*/
/*
@@ -60,6 +60,7 @@ Last Modified: $Date: 2004-01-22 22:18:49 $
* 2.2 is selected, EPICS base patches must be applied as
* described in;
* http://www.aps.anl.gov/upd/people/sluiter/epics/motor/R5-2/Problems.html
* .07 02-03-04 rls - Eliminate erroneous "Motor motion timeout ERROR".
*/
/*========================stepper motor driver ========================
@@ -85,9 +86,14 @@ Last Modified: $Date: 2004-01-22 22:18:49 $
#include <rebootLib.h>
#include <logLib.h>
#include <drvSup.h>
#include <epicsVersion.h>
#if EPICS_MODIFICATION <= 4
extern "C" {
#include <devLib.h>
}
#else
#include <devLib.h>
#endif
#include <dbAccess.h>
#include <epicsThread.h>
#include <epicsInterrupt.h>
@@ -230,7 +236,7 @@ static int set_status(int card, int signal)
struct axis_status *ax_stat;
struct encoder_status *en_stat;
char q_buf[50], outbuf[50];
int index, pos;
int index, motorData;
int rtn_state;
bool ls_active = false;
msta_field status;
@@ -282,12 +288,18 @@ static int set_status(int card, int signal)
break;
case 1: /* motor pulse count (position) */
sscanf(p, "%index", &pos);
sscanf(p, "%index", &motorData);
if (pos == motor_info->position)
motor_info->no_motion_count++;
if (motorData == motor_info->position)
{
if (nodeptr != 0) /* Increment counter only if motor is moving. */
motor_info->no_motion_count++;
}
else
{
motor_info->no_motion_count = 0;
motor_info->position = motorData;
}
if (motor_info->no_motion_count > motionTO)
{
@@ -300,7 +312,6 @@ static int set_status(int card, int signal)
else
status.Bits.RA_PROBLEM = 0;
motor_info->position = pos;
break;
case 2: /* encoder pulse count (position) */
{
@@ -858,8 +869,8 @@ static int motorIsrEnable(int card)
pmotor = (struct vmex_motor *) (pmotorState->localaddr);
status = devConnectInterrupt(intVME, omsInterruptVector + card,
(void (*)()) motorIsr, (void *) card);// Tornado 2.0.2
// Tornado 2.2 (devLibVOIDFUNCPTR) motorIsr, (void *) card);
(void (*)()) motorIsr, (void *) card);// Tornado 2.0.2
// Tornado 2.2 (devLibVOIDFUNCPTR) motorIsr, (void *) card);
if (!RTN_SUCCESS(status))
{
@@ -919,8 +930,8 @@ static void motorIsrDisable(int card)
pmotor->control = 0;
status = devDisconnectInterrupt(intVME, omsInterruptVector + card,
(void (*)()) motorIsr);// Tornado 2.0.2
// Tornado 2.2 (devLibVOIDFUNCPTR) motorIsr);
(void (*)()) motorIsr);// Tornado 2.0.2
// Tornado 2.2 (devLibVOIDFUNCPTR) motorIsr);
if (!RTN_SUCCESS(status))
errPrintf(status, __FILE__, __LINE__, "Can't disconnect vector %d\n",
omsInterruptVector + card);
+16 -6
View File
@@ -2,9 +2,9 @@
FILENAME... drvOms58.cc
USAGE... Motor record driver level support for OMS model VME58.
Version: $Revision: 1.9 $
Version: $Revision: 1.10 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2003-12-19 18:36:11 $
Last Modified: $Date: 2004-02-03 20:09:00 $
*/
/*
@@ -79,6 +79,7 @@ Last Modified: $Date: 2003-12-19 18:36:11 $
* 2.2 is selected, EPICS base patches must be applied as
* described in;
* http://www.aps.anl.gov/upd/people/sluiter/epics/motor/R5-2/Problems.html
* .26 02-03-04 rls - Eliminate erroneous "Motor motion timeout ERROR".
*/
#include <vxLib.h>
@@ -89,9 +90,14 @@ Last Modified: $Date: 2003-12-19 18:36:11 $
#include <taskLib.h>
#include <dbCommon.h>
#include <drvSup.h>
#include <epicsVersion.h>
#if EPICS_MODIFICATION <= 4
extern "C" {
#include <devLib.h>
}
#else
#include <devLib.h>
#endif
#include <dbAccess.h>
#include <epicsThread.h>
@@ -441,7 +447,10 @@ STATIC int set_status(int card, int signal)
motorData = pack2x16(pmotorData->cmndPos);
if (motorData == motor_info->position)
motor_info->no_motion_count++;
{
if (nodeptr != 0) /* Increment counter only if motor is moving. */
motor_info->no_motion_count++;
}
else
{
motor_info->position = motorData;
@@ -557,7 +566,8 @@ errorexit: errMessage(-1, "Invalid device directive");
* get off limit switch; resulting in limit error. Fix is to force CDIR to match
* MSTA.RA_DIRECTION.
*/
if (ls_active == true && status.Bits.GAIN_SUPPORT && status.Bits.EA_POSITION == 0)
if (ls_active == true && status.Bits.GAIN_SUPPORT &&
status.Bits.EA_POSITION == 0 && nodeptr != 0)
{
struct motorRecord *mr = (struct motorRecord *) nodeptr->mrecord;
@@ -924,8 +934,8 @@ STATIC int motorIsrSetup(int card)
pmotor = (struct vmex_motor *) (motor_state[card]->localaddr);
status = devConnectInterrupt(intVME, omsInterruptVector + card,
(void (*)()) motorIsr, (void *) card); // Tornado 2.0.2
// Tornado 2.2 (devLibVOIDFUNCPTR) motorIsr, (void *) card);
(void (*)()) motorIsr, (void *) card);// Tornado 2.0.2
// Tornado 2.2 (devLibVOIDFUNCPTR) motorIsr, (void *) card);
if (!RTN_SUCCESS(status))
{
errPrintf(status, __FILE__, __LINE__, "Can't connect to vector %d\n", omsInterruptVector + card);