forked from epics_driver_modules/motorBase
Override invalid acceleration rates.
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
FILENAME... devOmsCom.cc
|
||||
USAGE... Data and functions common to all OMS device level support.
|
||||
|
||||
Version: $Revision: 1.7 $
|
||||
Version: $Revision: 1.8 $
|
||||
Modified By: $Author: sluiter $
|
||||
Last Modified: $Date: 2005-03-21 18:05:00 $
|
||||
Last Modified: $Date: 2005-03-24 17:39:22 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -55,6 +55,7 @@ Last Modified: $Date: 2005-03-21 18:05:00 $
|
||||
* .11 06-16-04 rls Terminate "LP" command with ";" to prevent MAXv stale data.
|
||||
* .12 08-27-04 rls Terminate "JG" command with ";" to prevent MAXv stale data.
|
||||
* .13 03-21-05 rls OSI - built for solaris and linux hosts.
|
||||
* .14 03-23-05 rls restrict acceleration to valid values.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -393,7 +394,11 @@ errorexit: errMessage(-1, "Invalid device directive");
|
||||
vel = NINT(parms[itera]);
|
||||
|
||||
if (vel <= vbase)
|
||||
{
|
||||
errPrintf(-1, __FILE__, __LINE__,
|
||||
"Overriding invalid velocity; slew <= base.\n");
|
||||
vel = vbase + 1;
|
||||
}
|
||||
sprintf(buffer, "%ld", vel);
|
||||
}
|
||||
break;
|
||||
@@ -411,6 +416,24 @@ errorexit: errMessage(-1, "Invalid device directive");
|
||||
}
|
||||
break;
|
||||
|
||||
case SET_ACCEL: /* Prevent invalid acceleration values. */
|
||||
{
|
||||
long valid_acc = NINT(parms[itera]);
|
||||
|
||||
if (valid_acc < 1 || valid_acc > 1000000000)
|
||||
{
|
||||
errPrintf(-1, __FILE__, __LINE__,
|
||||
"Overriding invalid acceleration.\n");
|
||||
|
||||
if (valid_acc < 1)
|
||||
valid_acc = 1;
|
||||
else
|
||||
valid_acc = 1000000000;
|
||||
}
|
||||
sprintf(buffer, "%ld", valid_acc);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(buffer, "%ld", NINT(parms[itera]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user