- Fixed a sign problem in amorset.c regarding aom and cox

- Fixed a bad encoding of float values when writing to the SPS
This commit is contained in:
2014-12-04 11:35:26 +01:00
parent ac5aee6062
commit 1cf0e3351a
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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: