Skip to content

Commit

Permalink
Merge pull request #108 from kmpeters/issue27
Browse files Browse the repository at this point in the history
Set LVIO=1 if DLLM > DHLM
  • Loading branch information
kmpeters authored Aug 21, 2018
2 parents a21b1cc + 270347d commit 741d429
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions motorApp/MotorSrc/motorRecord.cc
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@ again.
Initialize Limit violation field false.
IF (Software Travel limits are NOT disabled), AND,
(Dial readback violates dial high limit), OR,
(Dial readback violates dial low limit)
(Dial readback violates dial low limit), OR,
(Dial low limit is greater than dial high limit)
Set Limit violation field true.
ENDIF
...
Expand Down Expand Up @@ -666,7 +667,8 @@ static long init_record(dbCommon* arg, int pass)

if ((pmr->dhlm == pmr->dllm) && (pmr->dllm == 0.0))
;
else if ((pmr->drbv > pmr->dhlm + pmr->mres) || (pmr->drbv < pmr->dllm - pmr->mres))
else if ((pmr->drbv > pmr->dhlm + pmr->mres) || (pmr->drbv < pmr->dllm - pmr->mres) ||
(pmr->dllm > pmr->dhlm))
{
pmr->lvio = 1;
MARK(M_LVIO);
Expand Down Expand Up @@ -1149,7 +1151,7 @@ where the motor is in a sequence of movements that comprise a single motion.
Clear Limit violation field.
ELSE
IF Jog indicator is true in MIP field.
Update Limit violation (LVIO) based on Jog direction (JOGF/JOGR) and velocity (JVEL).
Update Limit violation (LVIO) based on Jog direction (JOGF/JOGR) and velocity (JVEL) or DLLM > HLLM
ELSE IF Homing indicator is true in MIP field.
Set Limit violation (LVIO) FALSE.
ENDIF
Expand Down Expand Up @@ -1389,7 +1391,8 @@ static long process(dbCommon *arg)
{
if (pmr->mip & MIP_JOG)
pmr->lvio = (pmr->jogf && (pmr->rbv > pmr->hlm - pmr->jvel)) ||
(pmr->jogr && (pmr->rbv < pmr->llm + pmr->jvel));
(pmr->jogr && (pmr->rbv < pmr->llm + pmr->jvel)) ||
(pmr->dllm > pmr->dhlm);
else if (pmr->mip & MIP_HOME)
pmr->lvio = false; /* Disable soft-limit error check during home search. */
}
Expand Down Expand Up @@ -2007,7 +2010,8 @@ static RTN_STATUS do_work(motorRecord * pmr, CALLBACK_VALUE proc_ind)
if ((pmr->dhlm == pmr->dllm) && (pmr->dllm == 0.0))
;
else if ((pmr->jogf && (pmr->val > pmr->hlm - pmr->jvel)) ||
(pmr->jogr && (pmr->val < pmr->llm + pmr->jvel)))
(pmr->jogr && (pmr->val < pmr->llm + pmr->jvel)) ||
(pmr->dllm > pmr->dhlm))
{
pmr->lvio = 1;
MARK(M_LVIO);
Expand Down Expand Up @@ -2306,6 +2310,9 @@ static RTN_STATUS do_work(motorRecord * pmr, CALLBACK_VALUE proc_ind)
/* Check for soft-travel limit violation */
if ((pmr->dhlm == pmr->dllm) && (pmr->dllm == 0.0))
pmr->lvio = false;
/* At least one limit is violated when DLLM > DHLM */
else if (pmr->dllm > pmr->dhlm)
pmr->lvio = true;
/* LVIO = TRUE, AND, Move request towards valid travel limit range. */
else if (((pmr->dval > pmr->dhlm) && (pmr->dval < pmr->ldvl)) ||
((pmr->dval < pmr->dllm) && (pmr->dval > pmr->ldvl)))
Expand Down

0 comments on commit 741d429

Please sign in to comment.