Return data type for SDOinfo for type array and return maxsub of index 0 for array and record, maxsub from object VAR

pull/51/head
Andreas Karlsson 2019-03-27 14:17:02 +01:00 committed by Hans-Erik Floryd
parent 1917a6f72b
commit ef6e55a6e2
1 changed files with 9 additions and 1 deletions

View File

@ -743,12 +743,20 @@ void SDO_getod (void)
int32_t nsub = SDO_findsubindex (nidx, 0);
const _objd *objd = SDOobjects[nidx].objdesc;
coel->datatype = htoes ((objd + nsub)->datatype);
coel->maxsub = SDOobjects[nidx].maxsub;
}
else if (SDOobjects[nidx].objtype == OTYPE_ARRAY)
{
int32_t nsub = SDO_findsubindex (nidx, 0);
const _objd *objd = SDOobjects[nidx].objdesc;
coel->datatype = htoes ((objd + nsub)->datatype);
coel->maxsub = SDOobjects[nidx].objdesc->value;
}
else
{
coel->datatype = htoes (0);
coel->maxsub = SDOobjects[nidx].objdesc->value;
}
coel->maxsub = SDOobjects[nidx].maxsub;
coel->objectcode = SDOobjects[nidx].objtype;
s = (uint8_t *) SDOobjects[nidx].name;
d = (uint8_t *) &(coel->name);