From 24a53e660e213ae6a57dc4d6f5648bed895ef85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Wed, 17 Nov 2021 08:39:26 +0100 Subject: [PATCH] motorRecord: Reset UEIP to No if no encoder is present When a database is loaded with UEIP=Yes and the controller says that there is no encoder present, reset UEIP to No --- motorApp/MotorSrc/motorRecord.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/motorApp/MotorSrc/motorRecord.cc b/motorApp/MotorSrc/motorRecord.cc index 03d83c6d..4550d68e 100644 --- a/motorApp/MotorSrc/motorRecord.cc +++ b/motorApp/MotorSrc/motorRecord.cc @@ -3633,6 +3633,12 @@ static void process_motor_info(motorRecord * pmr, bool initcall) /* Calculate raw and dial readback values. */ msta.All = pmr->msta; + + if ((pmr->ueip == motorUEIP_Yes) && (!(msta.Bits.EA_PRESENT))) + { + pmr->ueip = motorUEIP_No; + db_post_events(pmr, &pmr->urip, DBE_VAL_LOG); + } if (pmr->ueip == motorUEIP_Yes) { /* An encoder is present and the user wants us to use it. */