-
Notifications
You must be signed in to change notification settings - Fork 53
Description
The DVAL & OFF are incorrect after a LOAD_POS fails. The issue was first reported by motorAcsMotion users of axes with absolute encoders that never want the dial position to be reset. Documentation of this issue started in the motorAcsMotion repo:
It appears that the motor record assumes the LOAD_POS operation will never fail:
motor/motorApp/MotorSrc/motorRecord.cc
Lines 3810 to 3816 in 285f44d
| /* Load pos. into motor controller. Get new readback vals. */ | |
| INIT_MSG(); | |
| WRITE_MSG(LOAD_POS, &newpos); | |
| SEND_MSG(); | |
| INIT_MSG(); | |
| WRITE_MSG(GET_INFO, NULL); | |
| SEND_MSG(); |
And the only thing the asyn device support does when the LOAD_POS operation fails is print an error message:
motor/motorApp/MotorSrc/devMotorAsyn.c
Lines 694 to 712 in 285f44d
| case motorMoveAbs: | |
| case motorMoveRel: | |
| case motorHome: | |
| case motorPosition: | |
| case motorMoveVel: | |
| commandIsMove = 1; | |
| /* Intentional fall-through */ | |
| default: | |
| if (pmsg->interface == int32Type) { | |
| status = pPvt->pasynInt32->write(pPvt->asynInt32Pvt, pasynUser, | |
| pmsg->ivalue); | |
| } else { | |
| status = pPvt->pasynFloat64->write(pPvt->asynFloat64Pvt, pasynUser, | |
| pmsg->dvalue); | |
| } | |
| if (status != asynSuccess) { | |
| asynPrint(pasynUser, ASYN_TRACE_ERROR, | |
| "devMotorAsyn::asynCallback: %s pasyn{Float64,Int32}->write returned %s\n", | |
| pmr->name, pasynUser->errorMessage); |
It might be necessary to add a field to the motor record to prevent the LOAD_POS message from ever being sent to device support.