From 1cf0e3351a7190c654ebed8739459f1124324074 Mon Sep 17 00:00:00 2001 From: Koennecke Mark Date: Thu, 4 Dec 2014 11:35:26 +0100 Subject: [PATCH] - Fixed a sign problem in amorset.c regarding aom and cox - Fixed a bad encoding of float values when writing to the SPS --- amorset.c | 2 +- spss7.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/amorset.c b/amorset.c index 9f1478b..501ddea 100644 --- a/amorset.c +++ b/amorset.c @@ -272,7 +272,7 @@ static int updateActualPositions(pamorSet self, SConnection * pCon) aoz = getListMotorPosition(readList, "aoz"); sah = ABS(calcCompPosition(&self->A) - calcCompPosition(&self->S)); self->actuals2t = Atand((aoz-soz)/sah) + self->actualm2t; - self->actualath = self->actuals2t - self->actualm2t - aom; + self->actualath = -(self->actuals2t - self->actualm2t - aom); } else { com = getListMotorPosition(readList, "com"); self->actuals2t = com + self->actualm2t; diff --git a/spss7.c b/spss7.c index 6e64ca8..e82868c 100644 --- a/spss7.c +++ b/spss7.c @@ -290,7 +290,8 @@ static hdbCallbackReturn S7WriteCallback(pHdb currentNode, break; case 3: fval = (float)mm->v->v.doubleValue; - idata = htonl((int)fval); + memcpy(&idata,&fval,4); + idata = htonl(idata); MakeWriteMessage(writeAction,offset,4,&idata); break; default: