Synchronize field (SYNC) to set VAL/DVAL/RVAL to RBV/DRBV/RRBV.

This commit is contained in:
Ron Sluiter
2010-04-21 18:24:59 +00:00
parent 5f24d16cef
commit 82c26005f5
2 changed files with 19 additions and 0 deletions
+14
View File
@@ -138,6 +138,8 @@ HeadURL: $URL$
* - removed depreciated RES field.
* - changed MDEL/ADEL support for RBV so that record behaves
* the same as before when MDEL and ADEL are zero.
* .58 04-15-10 rls - Added SYNC field to synchronize VAL/DVAL/RVAL with
* RBV/DRBV/RRBV
*
*/
@@ -2316,6 +2318,18 @@ static RTN_STATUS do_work(motorRecord * pmr, CALLBACK_VALUE proc_ind)
else
SEND_MSG();
}
else if (pmr->sync != 0 && pmr->mip == MIP_DONE)
{
/* Sync target positions with readbacks. */
pmr->val = pmr->lval = pmr->rbv;
MARK(M_VAL);
pmr->dval = pmr->ldvl = pmr->drbv;
MARK(M_DVAL);
pmr->rval = pmr->lrvl = NINT(pmr->dval / pmr->mres);
MARK(M_RVAL);
pmr->sync = 0;
}
return(OK);
}
+5
View File
@@ -783,4 +783,9 @@ recordtype(motor) {
special(SPC_NOMOD)
interest(3)
}
field(SYNC,DBF_SHORT) {
prompt("Sync position")
pp(TRUE)
interest(1)
}
}