Added read of current limit values before setting. Otherwise could never set if one was currently invalid

This commit is contained in:
MarkRivers
2006-07-12 20:23:56 +00:00
parent d74aa242a4
commit aa1e0c2764
+16
View File
@@ -251,6 +251,14 @@ static int motorAxisSetDouble(AXIS_HDL pAxis, motorAxisParam_t function, double
case motorAxisLowLimit:
{
deviceValue = value*pAxis->stepSize;
/* We need to read the current highLimit because otherwise we could be setting it to an invalid value */
status = PositionerUserTravelLimitsGet(pAxis->pollSocket,
pAxis->positionerName,
&pAxis->lowLimit, &pAxis->highLimit);
if (status != 0) {
PRINT(pAxis->logParam, ERROR, "motorAxisSetDouble: error performing PositionerUserTravelLimitsGet "
"for high limit=%f, status=%d\n", deviceValue, status);
}
status = PositionerUserTravelLimitsSet(pAxis->pollSocket,
pAxis->positionerName,
deviceValue, pAxis->highLimit);
@@ -267,6 +275,14 @@ static int motorAxisSetDouble(AXIS_HDL pAxis, motorAxisParam_t function, double
case motorAxisHighLimit:
{
deviceValue = value*pAxis->stepSize;
/* We need to read the current highLimit because otherwise we could be setting it to an invalid value */
status = PositionerUserTravelLimitsGet(pAxis->pollSocket,
pAxis->positionerName,
&pAxis->lowLimit, &pAxis->highLimit);
if (status != 0) {
PRINT(pAxis->logParam, ERROR, "motorAxisSetDouble: error performing PositionerUserTravelLimitsGet "
"for high limit=%f, status=%d\n", deviceValue, status);
}
status = PositionerUserTravelLimitsSet(pAxis->pollSocket,
pAxis->positionerName,
pAxis->lowLimit, deviceValue);