Updated turboPmac version
This commit is contained in:
+54
-273
@@ -336,37 +336,13 @@ asynStatus detectorTowerController::pollDetectorAxes(
|
||||
|
||||
The motorStatusProblem_ field changes the motor record fields SEVR and STAT.
|
||||
*/
|
||||
plStatus = angleAxis->setIntegerParam(motorStatusProblem(), false);
|
||||
if (plStatus != asynSuccess) {
|
||||
paramLibAccessFailed(plStatus, "motorStatusProblem_", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setIntegerParam(motorStatusProblem(), false);
|
||||
if (plStatus != asynSuccess) {
|
||||
paramLibAccessFailed(plStatus, "motorStatusProblem_", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = supportAxis->setIntegerParam(motorStatusProblem(), false);
|
||||
if (plStatus != asynSuccess) {
|
||||
paramLibAccessFailed(plStatus, "motorStatusProblem_", supportAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorStatusProblem, false);
|
||||
setAxisParamChecked(liftAxis, motorStatusProblem, false);
|
||||
setAxisParamChecked(supportAxis, motorStatusProblem, false);
|
||||
|
||||
plStatus = angleAxis->setIntegerParam(motorStatusCommsError(), false);
|
||||
if (plStatus != asynSuccess) {
|
||||
paramLibAccessFailed(plStatus, "motorStatusCommsError_", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setIntegerParam(motorStatusCommsError(), false);
|
||||
if (plStatus != asynSuccess) {
|
||||
paramLibAccessFailed(plStatus, "motorStatusCommsError_", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = supportAxis->setIntegerParam(motorStatusCommsError(), false);
|
||||
if (plStatus != asynSuccess) {
|
||||
paramLibAccessFailed(plStatus, "motorStatusCommsError_", supportAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorStatusCommsError, false);
|
||||
setAxisParamChecked(liftAxis, motorStatusCommsError, false);
|
||||
setAxisParamChecked(supportAxis, motorStatusCommsError, false);
|
||||
|
||||
// Read the previous motor positions
|
||||
plStatus = angleAxis->motorPosition(&prevAngle);
|
||||
@@ -427,20 +403,12 @@ asynStatus detectorTowerController::pollDetectorAxes(
|
||||
*/
|
||||
|
||||
// Angle
|
||||
plStatus = getDoubleParam(angleAxisNo, motorLimitsOffset(), &limitsOffset);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorLimitsOffset_", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
getAxisParamChecked(angleAxis, motorLimitsOffset, &limitsOffset);
|
||||
angleHighLimit = angleHighLimit - limitsOffset;
|
||||
angleLowLimit = angleLowLimit + limitsOffset;
|
||||
|
||||
// Lift
|
||||
plStatus = getDoubleParam(liftAxisNo, motorLimitsOffset(), &limitsOffset);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorLimitsOffset_", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
getAxisParamChecked(liftAxis, motorLimitsOffset, &limitsOffset);
|
||||
liftHighLimit = liftHighLimit - limitsOffset;
|
||||
liftLowLimit = liftLowLimit + limitsOffset;
|
||||
|
||||
@@ -812,258 +780,84 @@ asynStatus detectorTowerController::pollDetectorAxes(
|
||||
Does the paramLib already contain an error message? If either this is the
|
||||
case or if error != 0, report a status problem for all axes.
|
||||
*/
|
||||
getStringParam(angleAxisNo, motorMessageText(), sizeof(waitingErrorMessage),
|
||||
waitingErrorMessage);
|
||||
getAxisParamChecked(angleAxis, motorMessageText, &waitingErrorMessage);
|
||||
|
||||
if (error != 0 || errorMessage[0] != '\0' ||
|
||||
waitingErrorMessage[0] != '\0') {
|
||||
|
||||
plStatus = angleAxis->setIntegerParam(motorStatusProblem(), true);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusProblem_",
|
||||
angleAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
|
||||
plStatus = liftAxis->setIntegerParam(motorStatusProblem(), true);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusProblem_",
|
||||
liftAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
|
||||
plStatus = supportAxis->setIntegerParam(motorStatusProblem(), true);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusProblem_",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorStatusProblem, true);
|
||||
setAxisParamChecked(liftAxis, motorStatusProblem, true);
|
||||
setAxisParamChecked(supportAxis, motorStatusProblem, true);
|
||||
}
|
||||
|
||||
// Update the error message text with the one created in this poll (in case
|
||||
// it is not empty).
|
||||
if (errorMessage[0] != '\0') {
|
||||
plStatus = angleAxis->setStringParam(motorMessageText(), errorMessage);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorMessageText_",
|
||||
angleAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setStringParam(motorMessageText(), errorMessage);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorMessageText_",
|
||||
liftAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
plStatus =
|
||||
supportAxis->setStringParam(motorMessageText(), errorMessage);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorMessageText_",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorMessageText, errorMessage);
|
||||
setAxisParamChecked(liftAxis, motorMessageText, errorMessage);
|
||||
setAxisParamChecked(supportAxis, motorMessageText, errorMessage);
|
||||
}
|
||||
|
||||
// Update the working position state PV
|
||||
plStatus = angleAxis->setIntegerParam(positionStateRBV(), positionState);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "positionStateRBV_", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setIntegerParam(positionStateRBV(), positionState);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "positionStateRBV_", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = supportAxis->setIntegerParam(positionStateRBV(), positionState);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "positionStateRBV_",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, positionStateRBV, positionState);
|
||||
setAxisParamChecked(liftAxis, positionStateRBV, positionState);
|
||||
setAxisParamChecked(supportAxis, positionStateRBV, positionState);
|
||||
|
||||
// The axes are always enabled
|
||||
plStatus = angleAxis->setIntegerParam(motorEnableRBV(), 1);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorEnableRBV_", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setIntegerParam(motorEnableRBV(), 1);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorEnableRBV_", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = supportAxis->setIntegerParam(motorEnableRBV(), 1);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorEnableRBV_", supportAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorEnableRBV, true);
|
||||
setAxisParamChecked(liftAxis, motorEnableRBV, true);
|
||||
setAxisParamChecked(supportAxis, motorEnableRBV, true);
|
||||
|
||||
// Are the axes currently moving?
|
||||
plStatus = angleAxis->setIntegerParam(motorStatusMoving(), *moving);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusMoving_", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setIntegerParam(motorStatusMoving(), *moving);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusMoving_", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = supportAxis->setIntegerParam(motorStatusMoving(), *moving);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusMoving_",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorStatusMoving, *moving);
|
||||
setAxisParamChecked(liftAxis, motorStatusMoving, *moving);
|
||||
setAxisParamChecked(supportAxis, motorStatusMoving, *moving);
|
||||
|
||||
// Is the axis movement done?
|
||||
plStatus = angleAxis->setIntegerParam(motorStatusDone(), !(*moving));
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusDone_", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setIntegerParam(motorStatusDone(), !(*moving));
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusDone_", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = supportAxis->setIntegerParam(motorStatusDone(), !(*moving));
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusDone_", supportAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorStatusDone, !(*moving));
|
||||
setAxisParamChecked(liftAxis, motorStatusDone, !(*moving));
|
||||
setAxisParamChecked(supportAxis, motorStatusDone, !(*moving));
|
||||
|
||||
// In which direction are the axes currently moving?
|
||||
plStatus = angleAxis->setIntegerParam(motorStatusDirection(), angleDir);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusDirection_",
|
||||
angleAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setIntegerParam(motorStatusDirection(), liftDir);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusDirection_",
|
||||
liftAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorStatusDirection, angleDir);
|
||||
setAxisParamChecked(liftAxis, motorStatusDirection, liftDir);
|
||||
// Using the lift direction for the support axis is done on purpose!
|
||||
plStatus = supportAxis->setIntegerParam(motorStatusDirection(), liftDir);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorStatusDirection_",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(supportAxis, motorStatusDirection, liftDir);
|
||||
|
||||
// High limits from hardware
|
||||
plStatus =
|
||||
setDoubleParam(angleAxisNo, motorHighLimitFromDriver(), angleHighLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorHighLimitFromDriver",
|
||||
angleAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus =
|
||||
setDoubleParam(liftAxisNo, motorHighLimitFromDriver(), liftHighLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorHighLimitFromDriver",
|
||||
liftAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorHighLimitFromDriver, angleHighLimit);
|
||||
setAxisParamChecked(liftAxis, motorHighLimitFromDriver, liftHighLimit);
|
||||
// Using the lift high limit for the support axis is done on purpose!
|
||||
plStatus = setDoubleParam(supportAxisNo, motorHighLimitFromDriver(),
|
||||
liftHighLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorHighLimitFromDriver",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(supportAxis, motorHighLimitFromDriver, liftHighLimit);
|
||||
|
||||
// Low limits from hardware
|
||||
plStatus =
|
||||
setDoubleParam(angleAxisNo, motorLowLimitFromDriver(), angleLowLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorLowLimitFromDriver",
|
||||
angleAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus =
|
||||
setDoubleParam(liftAxisNo, motorLowLimitFromDriver(), liftLowLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorLowLimitFromDriver",
|
||||
liftAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorLowLimitFromDriver, angleLowLimit);
|
||||
setAxisParamChecked(liftAxis, motorLowLimitFromDriver, liftLowLimit);
|
||||
// Using the lift low limit for the support axis is done on purpose!
|
||||
plStatus =
|
||||
setDoubleParam(supportAxisNo, motorLowLimitFromDriver(), liftLowLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorLowLimitFromDriver",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(supportAxis, motorLowLimitFromDriver, liftLowLimit);
|
||||
|
||||
// Write the motor origin
|
||||
plStatus = setDoubleParam(angleAxisNo, motorOrigin(), angleOrigin);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorOrigin", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = setDoubleParam(liftAxisNo, motorOrigin(), liftOrigin);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorOrigin", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = setDoubleParam(supportAxisNo, motorOrigin(), supportOrigin);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "supportOrigin", supportAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorOrigin, angleOrigin);
|
||||
setAxisParamChecked(liftAxis, motorOrigin, liftOrigin);
|
||||
setAxisParamChecked(supportAxis, motorOrigin, supportOrigin);
|
||||
|
||||
// Origin adjustment high limit
|
||||
plStatus =
|
||||
setDoubleParam(angleAxisNo, motorAdjustOriginHighLimitFromDriver(),
|
||||
angleAdjustOriginHighLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorOriginHighLimitFromDriver",
|
||||
angleAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus =
|
||||
setDoubleParam(liftAxisNo, motorAdjustOriginHighLimitFromDriver(),
|
||||
liftAdjustOriginHighLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorOriginHighLimitFromDriver",
|
||||
liftAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorAdjustOriginHighLimitFromDriver,
|
||||
angleAdjustOriginHighLimit);
|
||||
setAxisParamChecked(liftAxis, motorAdjustOriginHighLimitFromDriver,
|
||||
liftAdjustOriginHighLimit);
|
||||
// Using the lift high limit for the support axis is done on purpose!
|
||||
plStatus =
|
||||
setDoubleParam(supportAxisNo, motorAdjustOriginHighLimitFromDriver(),
|
||||
liftAdjustOriginHighLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorOriginHighLimitFromDriver",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(supportAxis, motorAdjustOriginHighLimitFromDriver,
|
||||
liftAdjustOriginHighLimit);
|
||||
|
||||
// Origin adjustment low limit
|
||||
plStatus =
|
||||
setDoubleParam(angleAxisNo, motorAdjustOriginLowLimitFromDriver(),
|
||||
angleAdjustOriginLowLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus,
|
||||
"motorAdjustOriginLowLimitFromDriver",
|
||||
angleAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = setDoubleParam(liftAxisNo, motorAdjustOriginLowLimitFromDriver(),
|
||||
liftAdjustOriginLowLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus,
|
||||
"motorAdjustOriginLowLimitFromDriver",
|
||||
liftAxisNo, __PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorAdjustOriginLowLimitFromDriver,
|
||||
angleAdjustOriginLowLimit);
|
||||
setAxisParamChecked(liftAxis, motorAdjustOriginLowLimitFromDriver,
|
||||
liftAdjustOriginLowLimit);
|
||||
// Using the lift low limit for the support axis is done on purpose!
|
||||
plStatus =
|
||||
setDoubleParam(supportAxisNo, motorAdjustOriginLowLimitFromDriver(),
|
||||
liftAdjustOriginLowLimit);
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(
|
||||
plStatus, "motorAdjustOriginLowLimitFromDriver", supportAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
setAxisParamChecked(supportAxis, motorAdjustOriginLowLimitFromDriver,
|
||||
liftAdjustOriginLowLimit);
|
||||
|
||||
// Axes positions
|
||||
plStatus = angleAxis->setMotorPosition(angle);
|
||||
@@ -1137,22 +931,9 @@ asynStatus detectorTowerController::pollDetectorAxes(
|
||||
one poll cycle, but are cleared afterwards. Persisting error messages will
|
||||
be recreated during each poll.
|
||||
*/
|
||||
plStatus = angleAxis->setStringParam(motorMessageText(), "");
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorMessageText_", angleAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = liftAxis->setStringParam(motorMessageText(), "");
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorMessageText_", liftAxisNo,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
plStatus = supportAxis->setStringParam(motorMessageText(), "");
|
||||
if (plStatus != asynSuccess) {
|
||||
return paramLibAccessFailed(plStatus, "motorMessageText_",
|
||||
supportAxisNo, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(angleAxis, motorMessageText, "");
|
||||
setAxisParamChecked(liftAxis, motorMessageText, "");
|
||||
setAxisParamChecked(supportAxis, motorMessageText, "");
|
||||
|
||||
return pollStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user