added POSITIVE_HOME NEGATIVE_HOME. (Ric Claus SLAC)
This commit is contained in:
@@ -96,6 +96,8 @@
|
||||
* .37 03-29-94 mcn converted to fast links
|
||||
* .38 09-27-95 lrd fix init to limit in overshoot check and retry
|
||||
* post monitors for mcw and mccw
|
||||
* .39 04-09-96 ric Pos/Neg limit algos changed to move max int
|
||||
* steps. Dev/Drv sup will interpret meaning
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
@@ -171,6 +173,8 @@ struct smdset {
|
||||
#define POSITION 1
|
||||
#define POSITIVE_LIMIT 1
|
||||
#define NEGATIVE_LIMIT 2
|
||||
#define POSITIVE_HOME 3
|
||||
#define NEGATIVE_HOME 4
|
||||
|
||||
static void alarm();
|
||||
static void monitor();
|
||||
@@ -680,10 +684,19 @@ struct steppermotorRecord *psm;
|
||||
/* set initial position */
|
||||
if (psm->mode == POSITION){
|
||||
if (psm->ialg != 0){
|
||||
if (psm->ialg == POSITIVE_LIMIT){
|
||||
status = (*pdset->sm_command)(psm,SM_MOVE,0x0fffff,0);
|
||||
}else if (psm->ialg == NEGATIVE_LIMIT){
|
||||
status = (*pdset->sm_command)(psm,SM_MOVE,-0x0fffff,0);
|
||||
switch (psm->ialg){
|
||||
case (POSITIVE_LIMIT):
|
||||
status = (*pdset->sm_command)(psm,SM_FIND_LIMIT,1,0);
|
||||
break;
|
||||
case (NEGATIVE_LIMIT):
|
||||
status = (*pdset->sm_command)(psm,SM_FIND_LIMIT,-1,0);
|
||||
break;
|
||||
case (POSITIVE_HOME):
|
||||
status = (*pdset->sm_command)(psm,SM_FIND_HOME,1,0);
|
||||
break;
|
||||
case (NEGATIVE_HOME):
|
||||
status = (*pdset->sm_command)(psm,SM_FIND_HOME,-1,0);
|
||||
break;
|
||||
}
|
||||
psm->sthm = 1;
|
||||
/* force a read of the position and status */
|
||||
|
||||
@@ -2,6 +2,8 @@ menu(steppermotorIALG) {
|
||||
choice(steppermotorIALG_No_Initialization,"No Initialization")
|
||||
choice(steppermotorIALG_Move_to_the_Positive_Limit,"Move to the Positive Limit")
|
||||
choice(steppermotorIALG_Move_to_the_Negative_Limit,"Move to the Negative Limit")
|
||||
choice(steppermotorIALG_Move_to_Positive_Home,"Move to Positive Home")
|
||||
choice(steppermotorIALG_Move_to_Negative_Home,"Move to Negative Home")
|
||||
}
|
||||
menu(steppermotorMODE) {
|
||||
choice(steppermotorMODE_Velocity,"Velocity")
|
||||
|
||||
Reference in New Issue
Block a user