From 8c87ec9b9a541e46aebaf5c8009634936e05816d Mon Sep 17 00:00:00 2001 From: kmpeters Date: Mon, 11 Feb 2013 21:35:35 +0000 Subject: [PATCH] Changed stepsPerUnit from an int to a string in drvXPSAsyn.{c,h} --- README | 5 +++++ motorApp/NewportSrc/drvXPSAsyn.c | 21 ++++++++++++--------- motorApp/NewportSrc/drvXPSAsyn.h | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README b/README index a3d7589c..fc3ed7c6 100644 --- a/README +++ b/README @@ -179,6 +179,11 @@ Modification Log for R6-8 File modified: motorApp/MotorSrc/motorRecord.cc +4) The stepsPerUnit argument of XPSConfigAxis in the model 2 asyn XPS driver + has been changed from an int to a string. + + Files modified: motorApp/NewportSrc/drvXPSAsyn.c + motorApp/NewportSrc/drvXPSAsyn.h Modification Log for R6-7 ========================= diff --git a/motorApp/NewportSrc/drvXPSAsyn.c b/motorApp/NewportSrc/drvXPSAsyn.c index d662a6e7..5b34b02a 100644 --- a/motorApp/NewportSrc/drvXPSAsyn.c +++ b/motorApp/NewportSrc/drvXPSAsyn.c @@ -1581,12 +1581,14 @@ int XPSConfig(int card, /* Controller number */ int XPSConfigAxis(int card, /* specify which controller 0-up*/ int axis, /* axis number 0-7 */ const char *positionerName, /* groupName.positionerName e.g. Diffractometer.Phi */ - int stepsPerUnit, /* steps per user unit */ + const char *stepsPerUnit, /* steps per user unit */ int noDisabledError) /* If 1 then don't report disabled state as error */ { XPSController *pController; AXIS_HDL pAxis; char *index; + int status; + double stepSize; if (numXPSControllers < 1) { printf("XPSConfigAxis: no XPS controllers allocated, call XPSSetup first\n"); @@ -1613,14 +1615,15 @@ int XPSConfigAxis(int card, /* specify which controller 0-up*/ index = strchr(pAxis->groupName, '.'); if (index != NULL) *index = '\0'; /* Terminate group name at place of '.' */ - pAxis->stepSize = 1./stepsPerUnit; + stepSize = strtod(stepsPerUnit, NULL); + pAxis->stepSize = 1./stepSize; /* Read some information from the controller for this axis */ - PositionerSGammaParametersGet(pAxis->pollSocket, - pAxis->positionerName, - &pAxis->velocity, - &pAxis->accel, - &pAxis->minJerkTime, - &pAxis->maxJerkTime); + status = PositionerSGammaParametersGet(pAxis->pollSocket, + pAxis->positionerName, + &pAxis->velocity, + &pAxis->accel, + &pAxis->minJerkTime, + &pAxis->maxJerkTime); pAxis->mutexId = epicsMutexMustCreate(); /* Send a signal to the poller task which will make it do a poll, @@ -2324,7 +2327,7 @@ static void configXPSCallFunc(const iocshArgBuf *args) static const iocshArg XPSConfigAxisArg0 = {"Card number", iocshArgInt}; static const iocshArg XPSConfigAxisArg1 = {"Axis number", iocshArgInt}; static const iocshArg XPSConfigAxisArg2 = {"Axis name", iocshArgString}; -static const iocshArg XPSConfigAxisArg3 = {"Steps per unit", iocshArgInt}; +static const iocshArg XPSConfigAxisArg3 = {"Steps per unit", iocshArgString}; static const iocshArg XPSConfigAxisArg4 = {"No Disabled Error", iocshArgInt}; static const iocshArg * const XPSConfigAxisArgs[5] = {&XPSConfigAxisArg0, &XPSConfigAxisArg1, diff --git a/motorApp/NewportSrc/drvXPSAsyn.h b/motorApp/NewportSrc/drvXPSAsyn.h index 2ed72ae8..adb9f2ac 100644 --- a/motorApp/NewportSrc/drvXPSAsyn.h +++ b/motorApp/NewportSrc/drvXPSAsyn.h @@ -17,7 +17,7 @@ int XPSConfig(int card, /* Controller number */ int XPSConfigAxis(int card, /* specify which controller 0-up*/ int axis, /* axis number 0-7 */ const char *positionerName, /* groupName.positionerName e.g. Diffractometer.Phi */ - int stepsPerUnit, /* steps per user unit */ + const char *stepsPerUnit, /* steps per user unit */ int noDisabledError); /* If 1 then don't report disabled state as error */ void XPSDisablePoll(int disablePollVal);