Modified MM3000 and OMS device support to handle signed components of the encoder ratio.

This commit is contained in:
kpetersn
2018-06-27 11:39:00 -05:00
parent d7a85d2833
commit c185b99ea9
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -42,6 +42,7 @@ USAGE... Motor record device level support for Newport MM3000.
#include <string.h>
#include <stdlib.h>
#include <errlog.h>
#include <math.h>
#include "motorRecord.h"
#include "motor.h"
#include "motordevCom.h"
@@ -276,6 +277,10 @@ STATIC RTN_STATUS MM3000_build_trans(motor_cmnd command, double *parms, struct m
*/
break;
case SET_ENC_RATIO:
/* The motor record no longer passes unsigned values */
parms[0] = fabs(parms[0]);
parms[1] = fabs(parms[1]);
/* MM3000 valid encoder ratio values < 10,000. */
while (parms[0] > 10000.0 || parms[1] > 10000.0)
{
+1 -1
View File
@@ -513,7 +513,7 @@ errorexit: errMessage(-1, "Invalid device directive");
if (MAXv == true && parms[0] == parms[1])
sprintf(buffer, " UF");
else
sprintf(buffer, " UU%f;", parms[0]/parms[1]);
sprintf(buffer, " UU%f;", fabs(parms[0]/parms[1]));
strcat(motor_call->message, buffer);
break;