Fixed a bug with inproperly cleared MsgTxt in SINQAxis
Extended pmacAxis to properly deal with HRPT pmac motors which have an extra error condition
This commit is contained in:
@@ -558,9 +558,35 @@ asynStatus pmacCreateAxis(const char *pmacName, /* specify which control
|
||||
pC->unlock();
|
||||
return asynSuccess;
|
||||
}
|
||||
/**
|
||||
* C wrapper for the pmacHRPTAxis constructor.
|
||||
* See pmacHRPTAxis::pmacHRPTAxis.
|
||||
*
|
||||
*/
|
||||
asynStatus pmacCreateHRPTAxis(const char *pmacName, /* specify which controller by port name */
|
||||
int axis) /* axis number (start from 1). */
|
||||
{
|
||||
pmacController *pC;
|
||||
pmacAxis *pAxis;
|
||||
|
||||
static const char *functionName = "pmacCreateHRPTAxis";
|
||||
|
||||
pC = (pmacController*) findAsynPortDriver(pmacName);
|
||||
if (!pC) {
|
||||
printf("%s:%s: Error port %s not found\n",
|
||||
driverName, functionName, pmacName);
|
||||
return asynError;
|
||||
}
|
||||
|
||||
pC->lock();
|
||||
pAxis = new pmacHRPTAxis(pC, axis);
|
||||
pAxis = NULL;
|
||||
pC->unlock();
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
/**
|
||||
* C Wrapper function for pmacAxis constructor.
|
||||
* C Wrapper function for pmacHRPTAxis constructor.
|
||||
* See pmacAxis::pmacAxis.
|
||||
* This function allows creation of multiple pmacAxis objects with axis numbers 1 to numAxes.
|
||||
* @param pmacName Asyn port name for the controller (const char *)
|
||||
@@ -628,6 +654,18 @@ static void configpmacAxisCallFunc(const iocshArgBuf *args)
|
||||
pmacCreateAxis(args[0].sval, args[1].ival);
|
||||
}
|
||||
|
||||
/* pmacCreateHRPTAxis */
|
||||
static const iocshArg pmacCreateHRPTAxisArg0 = {"Controller port name", iocshArgString};
|
||||
static const iocshArg pmacCreateHRPTAxisArg1 = {"Axis number", iocshArgInt};
|
||||
static const iocshArg * const pmacCreateHRPTAxisArgs[] = {&pmacCreateAxisArg0,
|
||||
&pmacCreateAxisArg1};
|
||||
static const iocshFuncDef configpmacHRPTAxis = {"pmacCreateHRPTAxis", 2, pmacCreateHRPTAxisArgs};
|
||||
|
||||
static void configpmacHRPTAxisCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
pmacCreateHRPTAxis(args[0].sval, args[1].ival);
|
||||
}
|
||||
|
||||
/* pmacCreateAxes */
|
||||
static const iocshArg pmacCreateAxesArg0 = {"Controller port name", iocshArgString};
|
||||
static const iocshArg pmacCreateAxesArg1 = {"Num Axes", iocshArgInt};
|
||||
@@ -646,6 +684,7 @@ static void pmacControllerRegister(void)
|
||||
{
|
||||
iocshRegister(&configpmacCreateController, configpmacCreateControllerCallFunc);
|
||||
iocshRegister(&configpmacAxis, configpmacAxisCallFunc);
|
||||
iocshRegister(&configpmacHRPTAxis, configpmacHRPTAxisCallFunc);
|
||||
iocshRegister(&configpmacAxes, configpmacAxesCallFunc);
|
||||
}
|
||||
epicsExportRegistrar(pmacControllerRegister);
|
||||
|
||||
Reference in New Issue
Block a user