From 1252efb6b3264a5c5372d15e330c5c5da47dbfe5 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Fri, 5 Jul 2002 19:25:38 +0000 Subject: [PATCH] Restored SET_ENC_RATIO command. --- motorApp/ImsSrc/devIM483SM.c | 6 ++++-- motorApp/NewportSrc/devMM3000.c | 15 +++++++++++++-- motorApp/NewportSrc/devMM4000.c | 12 ++++++++++-- motorApp/NewportSrc/devPM500.c | 12 ++++++++++-- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/motorApp/ImsSrc/devIM483SM.c b/motorApp/ImsSrc/devIM483SM.c index 6f64a4fe..6d0f2819 100644 --- a/motorApp/ImsSrc/devIM483SM.c +++ b/motorApp/ImsSrc/devIM483SM.c @@ -3,9 +3,9 @@ FILENAME... devIM483SM.c USAGE... Motor record device level support for Intelligent Motion Systems, Inc. IM483(I/IE). -Version: $Revision: 1.7 $ +Version: $Revision: 1.8 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2002-04-15 20:07:24 $ +Last Modified: $Date: 2002-07-05 19:21:13 $ */ /* @@ -108,6 +108,7 @@ static int IM483SM_table[] = { IMMEDIATE, /* SET_VELOCITY */ IMMEDIATE, /* SET_ACCEL */ IMMEDIATE, /* GO */ + IMMEDIATE, /* SET_ENC_RATIO */ INFO, /* GET_INFO */ MOVE_TERM, /* STOP_AXIS */ VELOCITY, /* JOG */ @@ -315,6 +316,7 @@ STATIC long IM483SM_build_trans(motor_cmnd command, double *parms, struct motorR case SET_HIGH_LIMIT: case SET_LOW_LIMIT: + case SET_ENC_RATIO: trans->state = IDLE_STATE; /* No command sent to the controller. */ send = OFF; break; diff --git a/motorApp/NewportSrc/devMM3000.c b/motorApp/NewportSrc/devMM3000.c index f54c8f88..9d4781cf 100644 --- a/motorApp/NewportSrc/devMM3000.c +++ b/motorApp/NewportSrc/devMM3000.c @@ -2,9 +2,9 @@ FILENAME... devMM3000.c USAGE... Motor record device level support for Newport MM3000. -Version: $Revision: 1.6 $ +Version: $Revision: 1.7 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2002-04-01 22:44:14 $ +Last Modified: $Date: 2002-07-05 19:25:10 $ */ /* @@ -106,6 +106,7 @@ static int MM3000_table[] = { IMMEDIATE, /* SET_VELOCITY */ IMMEDIATE, /* SET_ACCEL */ IMMEDIATE, /* GO */ + IMMEDIATE, /* SET_ENC_RATIO */ INFO, /* GET_INFO */ MOVE_TERM, /* STOP_AXIS */ VELOCITY, /* JOG */ @@ -299,6 +300,16 @@ STATIC long MM3000_build_trans(motor_cmnd command, double *parms, struct motorRe * does nothing */ break; + case SET_ENC_RATIO: + /* MM3000 valid encoder ratio values < 10,000. */ + while (parms[0] > 10000.0 || parms[1] > 10000.0) + { + parms[0] /= 10; + parms[1] /= 10; + } + if (cntrl->type[axis - 1] == STEPPER) + sprintf(buff, "%dER%d:%d", axis, (int) parms[0], (int) parms[1]); + break; case GET_INFO: /* These commands are not actually done by sending a message, but rather they will indirectly cause the driver to read the status diff --git a/motorApp/NewportSrc/devMM4000.c b/motorApp/NewportSrc/devMM4000.c index dbfa356f..e98aa5df 100644 --- a/motorApp/NewportSrc/devMM4000.c +++ b/motorApp/NewportSrc/devMM4000.c @@ -2,9 +2,9 @@ FILENAME... devMM4000.c USAGE... Motor record device level support for Newport MM4000. -Version: $Revision: 1.5 $ +Version: $Revision: 1.6 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2002-04-01 22:44:16 $ +Last Modified: $Date: 2002-07-05 19:25:12 $ */ /* @@ -109,6 +109,7 @@ static int MM4000_table[] = { IMMEDIATE, /* SET_VELOCITY */ IMMEDIATE, /* SET_ACCEL */ IMMEDIATE, /* GO */ + IMMEDIATE, /* SET_ENC_RATIO */ INFO, /* GET_INFO */ MOVE_TERM, /* STOP_AXIS */ VELOCITY, /* JOG */ @@ -280,6 +281,13 @@ STATIC long MM4000_build_trans(motor_cmnd command, double *parms, struct motorRe */ break; + case SET_ENC_RATIO: + /* + * The MM4000 does not have the concept of encoder ratio, ignore this + * command + */ + break; + case GET_INFO: /* These commands are not actually done by sending a message, but rather they will indirectly cause the driver to read the status diff --git a/motorApp/NewportSrc/devPM500.c b/motorApp/NewportSrc/devPM500.c index 2735229b..5942119e 100644 --- a/motorApp/NewportSrc/devPM500.c +++ b/motorApp/NewportSrc/devPM500.c @@ -3,9 +3,9 @@ FILENAME... devPM500.c USAGE... Motor record device level support for the Newport PM500 motor controller. -Version: $Revision: 1.4 $ +Version: $Revision: 1.5 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2002-04-01 22:44:18 $ +Last Modified: $Date: 2002-07-05 19:25:38 $ */ /* @@ -108,6 +108,7 @@ static int PM500_table[] = { IMMEDIATE, /* SET_VELOCITY */ IMMEDIATE, /* SET_ACCEL */ IMMEDIATE, /* GO */ + IMMEDIATE, /* SET_ENC_RATIO */ INFO, /* GET_INFO */ MOVE_TERM, /* STOP_AXIS */ VELOCITY, /* JOG */ @@ -282,6 +283,13 @@ STATIC long PM500_build_trans(motor_cmnd command, double *parms, struct motorRec */ break; + case SET_ENC_RATIO: + /* + * The PM500 does not have the concept of encoder ratio, ignore this + * command + */ + break; + case GET_INFO: sprintf(buff, "%cR;", axis_name); break;