forked from epics_driver_modules/motorBase
second part of fix for limits when MRES -ve
When changing user limits, depend on both DIR and sign of MRES
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
FILENAME... motorRecord.cc
|
||||
USAGE... Motor Record Support.
|
||||
|
||||
Version: $Revision: 1.34 $
|
||||
Modified By: $Author: sluiter $
|
||||
Last Modified: $Date: 2006-12-18 20:13:31 $
|
||||
Version: $Revision: 1.35 $
|
||||
Modified By: $Author: peterd $
|
||||
Last Modified: $Date: 2007-02-02 13:55:34 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -2352,17 +2352,30 @@ static long special(DBADDR *paddr, int after)
|
||||
offset = pmr->off;
|
||||
if (dir_positive)
|
||||
{
|
||||
command = SET_HIGH_LIMIT;
|
||||
tmp_limit = pmr->hlm - offset;
|
||||
MARK(M_DHLM);
|
||||
}
|
||||
else
|
||||
{
|
||||
command = SET_LOW_LIMIT;
|
||||
tmp_limit = -(pmr->hlm) + offset;
|
||||
MARK(M_DLLM);
|
||||
}
|
||||
|
||||
/* Which controller limit we set depends not only on dir, but
|
||||
also on the sign of MRES */
|
||||
/* Direction +ve AND +ve MRES OR
|
||||
Direction -ve AND -ve MRES */
|
||||
if (dir_positive ^ (pmr->mres < 0))
|
||||
{
|
||||
command = SET_HIGH_LIMIT;
|
||||
}
|
||||
else
|
||||
/* Direction -ve AND +ve MRES OR
|
||||
Direction +ve AND -ve MRES */
|
||||
{
|
||||
command = SET_LOW_LIMIT;
|
||||
}
|
||||
|
||||
tmp_raw = tmp_limit / pmr->mres;
|
||||
|
||||
INIT_MSG();
|
||||
@@ -2393,17 +2406,30 @@ static long special(DBADDR *paddr, int after)
|
||||
offset = pmr->off;
|
||||
if (dir_positive)
|
||||
{
|
||||
command = SET_LOW_LIMIT;
|
||||
tmp_limit = pmr->llm - offset;
|
||||
MARK(M_DLLM);
|
||||
}
|
||||
else
|
||||
{
|
||||
command = SET_HIGH_LIMIT;
|
||||
tmp_limit = -(pmr->llm) + offset;
|
||||
MARK(M_DHLM);
|
||||
}
|
||||
|
||||
/* Which controller limit we set depends not only on dir, but
|
||||
also on the sign of MRES */
|
||||
/* Direction +ve AND +ve MRES OR
|
||||
Direction -ve AND -ve MRES */
|
||||
if (dir_positive ^ (pmr->mres < 0))
|
||||
{
|
||||
command = SET_LOW_LIMIT;
|
||||
}
|
||||
else
|
||||
/* Direction -ve AND +ve MRES OR
|
||||
Direction +ve AND -ve MRES */
|
||||
{
|
||||
command = SET_HIGH_LIMIT;
|
||||
}
|
||||
|
||||
tmp_raw = tmp_limit / pmr->mres;
|
||||
|
||||
INIT_MSG();
|
||||
|
||||
Reference in New Issue
Block a user