Skip to content

Commit 0aaf02d

Browse files
committed
motorRecord: prevent endless loop VAL-HOMF-VAL
The following lead to an endless loop: - move the motor by writing to the .VAL field - while moving, home the motor using the HOMF field - while still homing, write a different value to the VAL field. The problem is that for "pmr->val != pmr->lval" the motorRecord is send into do_work() and a new HOME is started. Solution: Reset the HOMF and HOMR buttons.
1 parent 995ffab commit 0aaf02d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

motorApp/MotorSrc/motorRecord.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,13 @@ static long process(dbCommon *arg)
13851385
!(pmr->mip & MIP_STOP) &&
13861386
!(pmr->mip & MIP_JOG_STOP))
13871387
{
1388+
if (pmr->mip == MIP_HOMF || pmr->mip == MIP_HOMR)
1389+
{
1390+
/* Bug fix: motor enters an infinite HOME loop
1391+
in a sequence where VAL HOMF VAL is written */
1392+
clear_buttons(pmr);
1393+
}
1394+
13881395
pmr->mip = MIP_DONE;
13891396
/* Bug fix, record locks-up when BDST != 0, DLY != 0 and
13901397
* new target position before backlash correction move.*/

0 commit comments

Comments
 (0)