forked from epics_driver_modules/motorBase
Added ERROR PV to hexapod support.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
grecord(mbbo,"$(P)$(R)CS") {
|
||||
field(DESC,"Coordinate System")
|
||||
field(DTYP, "asynInt32")
|
||||
field(OUT,"@asynMask($(PORT) $(CHAN) 0xFFFF)HXP_MOVE_COORD_SYS")
|
||||
field(OUT,"@asynMask($(PORT) 0 0xFFFF)HXP_MOVE_COORD_SYS")
|
||||
field(ZRVL,"0")
|
||||
field(ZRST,"Work")
|
||||
field(ONVL,"1")
|
||||
@@ -16,5 +16,14 @@ grecord(ai,"$(P)$(R)STATUS") {
|
||||
field(PINI, "1")
|
||||
field(PREC,"0")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(INP,"@asyn($(PORT),$(CHAN))HXP_STATUS")
|
||||
field(INP,"@asyn($(PORT),0)HXP_STATUS")
|
||||
}
|
||||
|
||||
grecord(ai,"$(P)$(R)ERROR") {
|
||||
field(DESC,"HXP Group Error")
|
||||
field(DTYP, "asynInt32")
|
||||
field(PINI, "1")
|
||||
field(PREC,"0")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(INP,"@asyn($(PORT),0)HXP_ERROR")
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ Note: This driver was tested with the v1.3.x of the firmware
|
||||
#define NINT(f) (int)((f)>0 ? (f)+0.5 : (f)-0.5)
|
||||
#define NUM_AXES 6
|
||||
#define GROUP "HEXAPOD"
|
||||
#define CS "Work"
|
||||
#define MRES 0.00001
|
||||
|
||||
static const char *driverName = "HXPDriver";
|
||||
@@ -57,6 +56,7 @@ HXPController::HXPController(const char *portName, const char *IPAddress, int IP
|
||||
|
||||
createParam(HXPMoveCoordSysString, asynParamInt32, &HXPMoveCoordSys_);
|
||||
createParam(HXPStatusString, asynParamInt32, &HXPStatus_);
|
||||
createParam(HXPErrorString, asynParamInt32, &HXPError_);
|
||||
|
||||
// This socket is used for polling by the controller and all axes
|
||||
pollSocket_ = HXPTCP_ConnectToServer((char *)IPAddress, IPPort, HXP_POLL_TIMEOUT);
|
||||
@@ -189,6 +189,7 @@ asynStatus HXPAxis::move(double position, int relative, double baseVelocity, dou
|
||||
double *pos;
|
||||
int coordSys; // 0 = work, 1 = tool
|
||||
static const char *functionName = "HXPAxis::move";
|
||||
asynStatus retval = asynSuccess;
|
||||
|
||||
pC_->getIntegerParam(pC_->HXPMoveCoordSys_, &coordSys);
|
||||
|
||||
@@ -210,7 +211,7 @@ asynStatus HXPAxis::move(double position, int relative, double baseVelocity, dou
|
||||
"%s:%s: Error performing HexapodMoveIncremental[%s,%d] %d\n",
|
||||
driverName, functionName, pC_->portName, axisNo_, status);
|
||||
/* Error -27 is caused when the motor record changes dir i.e. when it aborts a move! */
|
||||
return asynError;
|
||||
retval = asynError;
|
||||
}
|
||||
} else {
|
||||
// get current positions before moving (could an error overflow the array?)
|
||||
@@ -247,11 +248,24 @@ asynStatus HXPAxis::move(double position, int relative, double baseVelocity, dou
|
||||
"%s:%s: Error performing HexapodMoveAbsolute[%s,%d] %d\n",
|
||||
driverName, functionName, pC_->portName, axisNo_, status);
|
||||
/* Error -27 is caused when the motor record changes dir i.e. when it aborts a move! */
|
||||
return asynError;
|
||||
retval = asynError;
|
||||
}
|
||||
}
|
||||
|
||||
return asynSuccess;
|
||||
if (status < 0)
|
||||
{
|
||||
/* Set the error */
|
||||
pC_->setIntegerParam(pC_->HXPError_, status);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Clear the error */
|
||||
pC_->setIntegerParam(pC_->HXPError_, 0);
|
||||
}
|
||||
callParamCallbacks();
|
||||
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
asynStatus HXPAxis::home(double baseVelocity, double slewVelocity, double acceleration, int forwards)
|
||||
|
||||
@@ -14,6 +14,7 @@ USAGE... Motor driver support for the Newport Hexapod controller.
|
||||
// drvInfo strings for extra parameters that the HXP controller supports
|
||||
#define HXPMoveCoordSysString "HXP_MOVE_COORD_SYS"
|
||||
#define HXPStatusString "HXP_STATUS"
|
||||
#define HXPErrorString "HXP_ERROR"
|
||||
|
||||
class HXPAxis : public asynMotorAxis
|
||||
{
|
||||
@@ -54,7 +55,8 @@ protected:
|
||||
#define FIRST_HXP_PARAM HXPMoveCoordSys_
|
||||
int HXPMoveCoordSys_;
|
||||
int HXPStatus_;
|
||||
#define LAST_HXP_PARAM HXPStatus_
|
||||
int HXPError_;
|
||||
#define LAST_HXP_PARAM HXPError_
|
||||
|
||||
#define NUM_HXP_PARAMS ((int) (&LAST_HXP_PARAM - &FIRST_HXP_PARAM + 1))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user